@aikdna/kdna-core 0.15.7 → 0.15.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.15.8 (2026-06-28)
4
+
5
+ Story 11 — RAG namespace isolation (RFC #148 v2.x Phase 3).
6
+
7
+ - **`rag_namespace`** field added to each entry in `resolved_dependencies`.
8
+ Format: `name@version` (or bare `name` when version is absent). Provides a
9
+ stable scoped identifier for per-component namespace isolation.
10
+ - **`rag_isolation_policy`** object added to load output when
11
+ `resolved_dependencies` is non-empty:
12
+ `{ default: "fenced", cross_namespace_blocked: true, namespaces: [...] }`.
13
+ Consumers MUST NOT mix content across namespaces without explicit permission.
14
+ - **`--as=prompt` namespace header**: each component section in multi-asset
15
+ prompt output is now prefixed with `[NAMESPACE: name@version]` so RAG
16
+ systems can attribute and isolate content per source component (per SPEC
17
+ §13.8 source attribution).
18
+ - No breaking changes to existing single-asset load output or to
19
+ `resolved_dependencies` shape (fields are additive only).
20
+
3
21
  ## v0.15.7 (2026-06-28)
4
22
 
5
23
  Story 6 — dependencies runtime. Supports semver-matching local/registry dependency resolution and topological sort-based loading order.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikdna/kdna-core",
3
- "version": "0.15.7",
3
+ "version": "0.15.8",
4
4
  "description": "KDNA Core library for validating, planning, and loading local .kdna judgment assets.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
package/src/v1/index.js CHANGED
@@ -1844,18 +1844,36 @@ function loadV1Unsafe(inputPath, opts = {}) {
1844
1844
  throw new Error(`unknown load profile: ${profile}`);
1845
1845
  }
1846
1846
 
1847
- if (opts.resolvedDependencies && opts.resolvedDependencies.length > 0) {
1847
+ if (opts.resolvedDependencies && opts.resolvedDependencies.length > 0) {
1848
1848
  result.resolved_dependencies = opts.resolvedDependencies.map(dep => {
1849
1849
  const depLoaded = loadV1Unsafe(dep.path, { ...opts, resolvedDependencies: [] });
1850
+ // RAG namespace (Story 11): scoped identifier for namespace isolation.
1851
+ // Format: name@version (or just name when version is absent).
1852
+ const ragNamespace = dep.name
1853
+ ? (dep.version ? `${dep.name}@${dep.version}` : dep.name)
1854
+ : null;
1850
1855
  return {
1851
1856
  name: dep.name,
1852
1857
  version: dep.version,
1853
1858
  path: dep.path,
1859
+ rag_namespace: ragNamespace,
1854
1860
  status: depLoaded.status,
1855
1861
  profile: depLoaded.profile,
1856
1862
  content: depLoaded.content
1857
1863
  };
1858
1864
  });
1865
+
1866
+ // RAG isolation policy (Story 11): consumers MUST NOT mix content
1867
+ // across namespaces without explicit permission. cross_namespace_blocked
1868
+ // is the default; a consumer may opt in to cross-namespace access by
1869
+ // setting its own policy, but Core never does it silently.
1870
+ result.rag_isolation_policy = {
1871
+ default: 'fenced',
1872
+ cross_namespace_blocked: true,
1873
+ namespaces: result.resolved_dependencies
1874
+ .map(d => d.rag_namespace)
1875
+ .filter(Boolean),
1876
+ };
1859
1877
  }
1860
1878
 
1861
1879
  if (as === 'prompt') {
@@ -1887,7 +1905,13 @@ function loadV1Unsafe(inputPath, opts = {}) {
1887
1905
  for (const dep of opts.resolvedDependencies) {
1888
1906
  const depLoaded = loadV1Unsafe(dep.path, { ...opts, resolvedDependencies: [] });
1889
1907
  if (depLoaded.text) {
1890
- textOut += '\n\n---\n\n' + depLoaded.text;
1908
+ // Namespace header (Story 11): each component section is prefixed
1909
+ // with [NAMESPACE: id] so consumers can isolate RAG content per source.
1910
+ const ns = dep.name
1911
+ ? (dep.version ? `${dep.name}@${dep.version}` : dep.name)
1912
+ : null;
1913
+ const nsHeader = ns ? `[NAMESPACE: ${ns}]\n` : '';
1914
+ textOut += '\n\n---\n\n' + nsHeader + depLoaded.text;
1891
1915
  }
1892
1916
  }
1893
1917
  }