@aikdna/kdna-core 0.15.1 → 0.15.3
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 +21 -0
- package/package.json +1 -1
- package/src/v1/index.js +34 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.15.3 (2026-06-27)
|
|
4
|
+
- Fix (PC-2, real): `renderPromptItem` now actually ships the
|
|
5
|
+
boundary card branch. The previous v0.15.2 release (ee20c5e)
|
|
6
|
+
bumped package.json and added a CHANGELOG entry but did NOT
|
|
7
|
+
include the source change to `src/v1/index.js`. This release
|
|
8
|
+
re-bundles the fix that landed in 46047fb (PC-1/PC-4 cleanup).
|
|
9
|
+
Verified end-to-end: `kdna-studio card add boundary` with
|
|
10
|
+
non-empty `scope` + `out_of_scope` → `kdna load` now prints
|
|
11
|
+
`in scope: X; out of scope: Y` instead of the UUID `id`.
|
|
12
|
+
|
|
13
|
+
## v0.15.2 (2026-06-27)
|
|
14
|
+
- Fix (PC-2): `renderPromptItem` now renders boundary cards as
|
|
15
|
+
`in scope: X; out of scope: Y; exceptions: ...` instead of
|
|
16
|
+
falling through to the UUID `id`. The previous behavior made
|
|
17
|
+
boundaries unreadable in `kdna load --as=prompt` output. Empty
|
|
18
|
+
boundaries now surface as "(boundary card with empty scope)"
|
|
19
|
+
rather than the UUID, so authors can spot missing content.
|
|
20
|
+
- Fix (safety): the last-resort fall-through when no field
|
|
21
|
+
matches returns `(unrendered card: <type>)` instead of the
|
|
22
|
+
UUID `id`, so any unrecognized card shape is visible.
|
|
23
|
+
|
|
3
24
|
## v0.15.1 (2026-06-27)
|
|
4
25
|
- Fix: package.json `files` array now includes `CHANGELOG.md`. The
|
|
5
26
|
v0.15.0 tarball was published without the changelog, leaving
|
package/package.json
CHANGED
package/src/v1/index.js
CHANGED
|
@@ -1509,6 +1509,30 @@ function renderPromptItem(item) {
|
|
|
1509
1509
|
if (item.failure_risk) parts.push(`failure risk: ${item.failure_risk}`);
|
|
1510
1510
|
return parts.join(' — ');
|
|
1511
1511
|
}
|
|
1512
|
+
// Boundary card: kdna-studio writes { id, scope, out_of_scope,
|
|
1513
|
+
// acceptable_exceptions }. Render the scope/out-of-scope rule
|
|
1514
|
+
// instead of falling through to the UUID `id` (which was the
|
|
1515
|
+
// v0.15.0 behavior and made boundaries unreadable in
|
|
1516
|
+
// `kdna load --as=prompt`).
|
|
1517
|
+
if (
|
|
1518
|
+
item.type === 'boundary' ||
|
|
1519
|
+
(item.scope !== undefined && item.out_of_scope !== undefined)
|
|
1520
|
+
) {
|
|
1521
|
+
const parts = [];
|
|
1522
|
+
if (item.scope) parts.push(`in scope: ${sanitizePrompt(item.scope)}`);
|
|
1523
|
+
if (item.out_of_scope) parts.push(`out of scope: ${sanitizePrompt(item.out_of_scope)}`);
|
|
1524
|
+
if (Array.isArray(item.acceptable_exceptions) && item.acceptable_exceptions.length) {
|
|
1525
|
+
parts.push(`exceptions: ${item.acceptable_exceptions.map(sanitizePrompt).join('; ')}`);
|
|
1526
|
+
}
|
|
1527
|
+
if (parts.length === 0) {
|
|
1528
|
+
// Boundary card with empty scope/out_of_scope: surface as
|
|
1529
|
+
// "(boundary card with empty scope)" instead of falling through
|
|
1530
|
+
// to the UUID `id`. The author should fill in scope/out_of_scope
|
|
1531
|
+
// before publishing.
|
|
1532
|
+
return '(boundary card with empty scope)';
|
|
1533
|
+
}
|
|
1534
|
+
return parts.join('; ');
|
|
1535
|
+
}
|
|
1512
1536
|
if (item.boundary && item.one_sentence) return `${item.one_sentence}: ${item.boundary}`;
|
|
1513
1537
|
if (item.stance) return item.stance;
|
|
1514
1538
|
if (item.statement) return item.statement;
|
|
@@ -1521,8 +1545,16 @@ function renderPromptItem(item) {
|
|
|
1521
1545
|
if (item.one_sentence) return item.one_sentence;
|
|
1522
1546
|
if (item.essence) return item.essence;
|
|
1523
1547
|
if (item.question) return item.question;
|
|
1524
|
-
|
|
1525
|
-
|
|
1548
|
+
// Last-resort fall-through. Returning the id (e.g. "bo_xxxx-...") makes
|
|
1549
|
+
// the output unreadable; prefer a note that the card is unrecognized.
|
|
1550
|
+
return `(unrendered card: ${item.type || 'unknown'})`;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
function sanitizePrompt(s) {
|
|
1554
|
+
if (s === undefined || s === null) return '';
|
|
1555
|
+
if (typeof s === 'string') return s;
|
|
1556
|
+
if (Array.isArray(s)) return s.map(sanitizePrompt).join('; ');
|
|
1557
|
+
return String(s);
|
|
1526
1558
|
}
|
|
1527
1559
|
|
|
1528
1560
|
function loadAuthorized(inputPath, opts = {}) {
|