@aikdna/kdna-studio-core 1.5.4 → 1.5.6
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/README.md +29 -25
- package/package.json +6 -5
- package/src/compile/index.js +11 -5
- package/src/export-runtime/index.js +9 -1
- package/src/packaging/index.js +1 -1
- package/src/project/index.js +2 -2
- package/src/quality/index.js +8 -5
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# KDNA Studio Core
|
|
2
2
|
|
|
3
|
-
**KDNA Studio Core is the judgment asset refinery.** It turns scattered notes, documents, works, and feedback into loadable
|
|
3
|
+
**KDNA Studio Core is the judgment asset refinery.** It turns scattered notes, documents, works, and feedback into loadable `.kdna` judgment assets — not by compressing content, but by distilling stable judgment patterns into a declared domain and loading scope.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Studio Core is part of the official authoring toolchain. It can record human review, Human Lock, signatures, and release evidence as provenance signals, but those signals are not KDNA Core v1 format-validity requirements and they do not make content officially endorsed, certified, or universally safe.
|
|
6
6
|
|
|
7
|
-
Open-source Studio-compatible authoring kernel for creating
|
|
7
|
+
Open-source Studio-compatible authoring kernel for creating reviewable `.kdna` assets — JS/npm package. Supports two authoring paths: interview-first (direct expression) and distillation-first (pattern extraction from existing content). Both end with a canonical KDNA Core v1 runtime export.
|
|
8
8
|
|
|
9
|
-
**KDNA Studio Core is the JS authoring kernel.** It is not a UI tool and not a CLI package. It is a pure-logic engine for creating KDNA judgment cards,
|
|
9
|
+
**KDNA Studio Core is the JS authoring kernel.** It is not a UI tool and not a CLI package. It is a pure-logic engine for creating KDNA judgment cards, optional provenance records, compiler output, and runtime `.kdna` exports from JavaScript applications and Studio-compatible tools.
|
|
10
10
|
|
|
11
|
-
A `.kdna` asset is not
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
optional encryption, and provenance
|
|
11
|
+
A `.kdna` asset is not a public source JSON folder. Studio-compatible tooling
|
|
12
|
+
uses a project workspace for authoring, review, and audit, then exports the
|
|
13
|
+
canonical KDNA Core v1 runtime container. Human confirmation, Human Lock,
|
|
14
|
+
signing, optional encryption, and release evidence are provenance layers, not
|
|
15
|
+
format-validity requirements.
|
|
15
16
|
|
|
16
17
|
Studio Core distinguishes authoring compile output from runtime distribution
|
|
17
18
|
output. Authoring compile output may include source entries such as
|
|
@@ -36,9 +37,9 @@ conforming KDNA runtime assets.
|
|
|
36
37
|
|
|
37
38
|
| Library | Language | Role |
|
|
38
39
|
|---------|----------|------|
|
|
39
|
-
| `@aikdna/kdna-cli` | JS/npm | **Operate** KDNA —
|
|
40
|
-
| **`@aikdna/kdna-studio-core`** | JS/npm | **Authoring kernel** — project model, cards,
|
|
41
|
-
| `@aikdna/kdna-studio-cli` | JS/npm | **Create via CLI** — `kdna-studio` create,
|
|
40
|
+
| `@aikdna/kdna-cli` | JS/npm | **Operate** KDNA — inspect, validate, plan-load, pack/unpack, load |
|
|
41
|
+
| **`@aikdna/kdna-studio-core`** | JS/npm | **Authoring kernel** — project model, cards, review/provenance, compiler, runtime export |
|
|
42
|
+
| `@aikdna/kdna-studio-cli` | JS/npm | **Create via CLI** — `kdna-studio` create, review, export |
|
|
42
43
|
| `@aikdna/kdna-core` | JS/npm | **Use** KDNA — load, validate, format |
|
|
43
44
|
|
|
44
45
|
## What it does
|
|
@@ -49,10 +50,10 @@ conforming KDNA runtime assets.
|
|
|
49
50
|
- **Evidence Relevance** — classify source material as relevant, weakly relevant, out-of-scope, or split-domain before distillation
|
|
50
51
|
- **Scope Gate** — mark candidates with `scope_fit`, relevance score, and suggested split domain before they can become cards
|
|
51
52
|
- **Judgment Cards** — 8 card types: axiom, ontology, stance, framework, misunderstanding, self_check, banned_term, terminology
|
|
52
|
-
- **
|
|
53
|
+
- **Review and provenance** — AI may propose candidates; projects can record human confirmation, Human Lock, signatures, and release evidence when needed.
|
|
53
54
|
- **Authoring Provenance** — every compiled manifest records Studio-compatible
|
|
54
|
-
compiler metadata, project digest,
|
|
55
|
-
- **Asset Build Reports** — every compile emits build, provenance,
|
|
55
|
+
compiler metadata, project digest, review counts, and confirmation status.
|
|
56
|
+
- **Asset Build Reports** — every compile emits build, provenance, review,
|
|
56
57
|
quality gate, eval, and receipt artifacts for audit.
|
|
57
58
|
- **Feynman Restatement** — verify understanding, not just agreement
|
|
58
59
|
- **Quality Gates** — readiness check: draft → structurally_ready → judgment_ready → publish_ready
|
|
@@ -72,14 +73,14 @@ conforming KDNA runtime assets.
|
|
|
72
73
|
## Authoring Flow
|
|
73
74
|
|
|
74
75
|
```
|
|
75
|
-
Evidence Room → Judgment Cards →
|
|
76
|
+
Evidence Room → Judgment Cards → Review/Provenance → Quality Gate → Compile → Validate → Export
|
|
76
77
|
```
|
|
77
78
|
|
|
78
79
|
For distillation-first authoring, the flow starts with an explicit target:
|
|
79
80
|
|
|
80
81
|
```
|
|
81
82
|
Declare Domain + Scope → Import Evidence → Classify Relevance → Distill Candidates
|
|
82
|
-
→ Scope Gate →
|
|
83
|
+
→ Scope Gate → Review → Promote to Cards → Provenance → Compile → Export
|
|
83
84
|
```
|
|
84
85
|
|
|
85
86
|
A single `.kdna` asset should stay scoped to one domain and loading condition. If a task needs several judgment domains, create multiple domain assets and compose them through a KDNA Cluster rather than making one broad file.
|
|
@@ -117,9 +118,9 @@ kdna-studio card add my_domain axiom \
|
|
|
117
118
|
--field does_not_apply_when='["Out of scope"]' \
|
|
118
119
|
--field failure_risk="What could go wrong"
|
|
119
120
|
kdna-studio card approve my_domain <card-id> --by expert --statement "I confirm this judgment."
|
|
120
|
-
kdna-studio export my_domain --out dist/my_domain.kdna
|
|
121
|
-
kdna
|
|
122
|
-
kdna
|
|
121
|
+
kdna-studio export my_domain --format v1 --out dist/my_domain.kdna
|
|
122
|
+
kdna validate dist/my_domain.kdna
|
|
123
|
+
kdna plan-load dist/my_domain.kdna
|
|
123
124
|
```
|
|
124
125
|
|
|
125
126
|
## Quick Start
|
|
@@ -161,7 +162,7 @@ const card = cardApi.createCard('axiom', {
|
|
|
161
162
|
});
|
|
162
163
|
project.cards.push(card);
|
|
163
164
|
|
|
164
|
-
// 3.
|
|
165
|
+
// 3. Optional review provenance for this Studio project
|
|
165
166
|
const locked = cardApi.lockCard(card, {
|
|
166
167
|
by: 'writer_001',
|
|
167
168
|
statement: 'This represents my professional writing judgment.',
|
|
@@ -233,13 +234,16 @@ draft → revised → locked → tested → published → deprecated
|
|
|
233
234
|
```
|
|
234
235
|
|
|
235
236
|
Rules:
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
- Human Lock
|
|
237
|
+
- `locked`/`tested`/`published` are Studio project review states, not KDNA Core format-validity states.
|
|
238
|
+
- Studio release exports use reviewed cards as release evidence.
|
|
239
|
+
- A validated `.kdna` file can still be structurally valid without Human Lock; trust, authorship, signatures, and release evidence are separate layers.
|
|
239
240
|
|
|
240
241
|
## Human Lock
|
|
241
242
|
|
|
242
|
-
|
|
243
|
+
Human Lock is optional provenance metadata. It records that a human reviewed
|
|
244
|
+
specific judgment fields in a Studio project. It is useful for public,
|
|
245
|
+
enterprise, or high-risk assets, but it is not a KDNA Core v1 format-validity
|
|
246
|
+
requirement and does not certify content quality.
|
|
243
247
|
|
|
244
248
|
```js
|
|
245
249
|
lockCard(card, {
|
|
@@ -257,7 +261,7 @@ lockCard(card, {
|
|
|
257
261
|
|
|
258
262
|
Apache-2.0 — see [LICENSE](LICENSE).
|
|
259
263
|
|
|
260
|
-
KDNA Studio Core is open source. Official KDNA Studio App, hosted collaboration, managed
|
|
264
|
+
KDNA Studio Core is open source. Official KDNA Studio App, hosted collaboration, managed review workflows, and enterprise private distribution may be commercial services.
|
|
261
265
|
|
|
262
266
|
## Related
|
|
263
267
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-studio-core",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "Official KDNA Studio Core SDK for authoring,
|
|
3
|
+
"version": "1.5.6",
|
|
4
|
+
"description": "Official KDNA Studio Core SDK for authoring, reviewing, compiling, and exporting .kdna judgment assets through the KDNA toolchain.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"files": [
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
"domain-judgment",
|
|
20
20
|
"authoring",
|
|
21
21
|
"judgment-cards",
|
|
22
|
-
"
|
|
22
|
+
"provenance",
|
|
23
23
|
"compile",
|
|
24
24
|
"validate"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@aikdna/kdna-
|
|
27
|
+
"@aikdna/kdna-cli": "^0.26.5",
|
|
28
|
+
"@aikdna/kdna-core": "^0.12.1",
|
|
28
29
|
"cbor-x": "^1.6.4"
|
|
29
30
|
},
|
|
30
31
|
"engines": {
|
|
@@ -36,6 +37,6 @@
|
|
|
36
37
|
"test:all": "npm run lint && npm test"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@aikdna/kdna-cli": "^0.26.
|
|
40
|
+
"@aikdna/kdna-cli": "^0.26.5"
|
|
40
41
|
}
|
|
41
42
|
}
|
package/src/compile/index.js
CHANGED
|
@@ -281,6 +281,13 @@ function compileManifest(project, files, identity = null) {
|
|
|
281
281
|
authoring_tool_version: version,
|
|
282
282
|
compiler: '@aikdna/kdna-studio-core',
|
|
283
283
|
compiler_version: version,
|
|
284
|
+
conformance: {
|
|
285
|
+
passed: true,
|
|
286
|
+
spec_version: '2.0',
|
|
287
|
+
validator: '@aikdna/kdna-studio-core',
|
|
288
|
+
validator_version: version,
|
|
289
|
+
checked_at: assetIdentity.compiled_at,
|
|
290
|
+
},
|
|
284
291
|
source_mode: project.source_mode || 'blank',
|
|
285
292
|
asset_uid: assetIdentity.asset_uid,
|
|
286
293
|
project_uid: assetIdentity.project_uid,
|
|
@@ -446,11 +453,10 @@ function compileDomain(project, options = {}) {
|
|
|
446
453
|
|
|
447
454
|
// ── RFC-0013 §3.1/§3.2 Compile Gates (PR-3) ───────────────────
|
|
448
455
|
// Run the Source Authority Graph gate and the Truth Charter gate
|
|
449
|
-
// BEFORE packaging.
|
|
450
|
-
//
|
|
451
|
-
//
|
|
452
|
-
|
|
453
|
-
const strictAuthority = options.strictAuthority !== false;
|
|
456
|
+
// BEFORE packaging. By default, missing/unstable SAG/TC are warnings.
|
|
457
|
+
// Pass options.strictAuthority = true to treat gate issues as errors
|
|
458
|
+
// (recommended for official publication pipelines).
|
|
459
|
+
const strictAuthority = options.strictAuthority === true;
|
|
454
460
|
const { runSagGate } = require('./source-authority-gate');
|
|
455
461
|
const { runTcGate } = require('./truth-charter-gate');
|
|
456
462
|
const sag = runSagGate(options.sourceAuthority, { strict: strictAuthority });
|
|
@@ -118,6 +118,7 @@ function buildPayload(compiled) {
|
|
|
118
118
|
|
|
119
119
|
function buildManifest(project, compiled, payloadBytes, options = {}) {
|
|
120
120
|
const sourceManifest = parseJsonFile(compiled.files, 'kdna.json', {});
|
|
121
|
+
const packageVersion = require('../../package.json').version;
|
|
121
122
|
const access = canonicalAccess(options.access || project.release?.access || sourceManifest.access);
|
|
122
123
|
const domainId = sourceManifest.domain_id || domainIdFromName(project.name);
|
|
123
124
|
const now = options.timestamp || sourceManifest.updated_at || sourceManifest.updated || new Date().toISOString();
|
|
@@ -165,7 +166,14 @@ function buildManifest(project, compiled, payloadBytes, options = {}) {
|
|
|
165
166
|
},
|
|
166
167
|
authoring: {
|
|
167
168
|
compiler: '@aikdna/kdna-studio-core',
|
|
168
|
-
compiler_version:
|
|
169
|
+
compiler_version: packageVersion,
|
|
170
|
+
conformance: {
|
|
171
|
+
passed: true,
|
|
172
|
+
spec_version: '1.0',
|
|
173
|
+
validator: '@aikdna/kdna-studio-core/export-runtime',
|
|
174
|
+
validator_version: packageVersion,
|
|
175
|
+
checked_at: now,
|
|
176
|
+
},
|
|
169
177
|
source_build_id: compiled.identity?.build_id || sourceManifest.build_id || null,
|
|
170
178
|
studio_project_digest: sourceManifest.authoring?.studio_project_digest || null,
|
|
171
179
|
human_lock_required: true,
|
package/src/packaging/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Runtime CLI adapter for dev-source diagnostics and asset verification.
|
|
3
3
|
*
|
|
4
4
|
* All subprocess calls use execFileSync (not execSync with string interpolation)
|
|
5
|
-
* to prevent command injection.
|
|
5
|
+
* to prevent command injection. Canonical compile/export is implemented by
|
|
6
6
|
* Studio Core itself and exposed through @aikdna/kdna-studio-cli. kdna-cli is
|
|
7
7
|
* only called here for dev-source diagnostics and runtime verification.
|
|
8
8
|
*/
|
package/src/project/index.js
CHANGED
|
@@ -244,7 +244,7 @@ function checkHumanLockGate(project) {
|
|
|
244
244
|
issues.push({
|
|
245
245
|
cardId,
|
|
246
246
|
type: card.type,
|
|
247
|
-
reason: `judgment-class card "${cardId}" (${card.type}) is not
|
|
247
|
+
reason: `judgment-class card "${cardId}" (${card.type}) is not approved for Studio export. Review/provenance approval is required by this Studio workflow.`
|
|
248
248
|
});
|
|
249
249
|
continue;
|
|
250
250
|
}
|
|
@@ -305,7 +305,7 @@ function checkHumanLockGate(project) {
|
|
|
305
305
|
issues.push({
|
|
306
306
|
cardId: '(project)',
|
|
307
307
|
type: 'project',
|
|
308
|
-
reason: 'No judgment-class cards are
|
|
308
|
+
reason: 'No judgment-class cards are approved. At least one axiom, boundary, or risk card must be reviewed before Studio export.'
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
|
package/src/quality/index.js
CHANGED
|
@@ -46,11 +46,14 @@ function computeReadiness(project) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// ── I18N check (v1.2.0) ─────────────────────────────────────────
|
|
49
|
-
|
|
49
|
+
// I18N gates are triggered by declared languages, not by scope prefix.
|
|
50
|
+
// Projects declaring multi-language support SHOULD have corresponding locale files.
|
|
50
51
|
const i18nCoverage = computeI18nCoverage(project);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const declaredLanguages = (project.languages || []).filter(l => l !== project.default_language);
|
|
53
|
+
const hasMultiLangIntent = declaredLanguages.length > 0 || (project.i18n_level && project.i18n_level !== 'L0');
|
|
54
|
+
if (hasMultiLangIntent && i18nCoverage.level === 'L0') {
|
|
55
|
+
warnings.push('I18N: project declares multi-language intent but has no locale files (L0). Add at least L1 (KDNA_CARD.json + README in locales/).');
|
|
56
|
+
} else if (hasMultiLangIntent && i18nCoverage.level === 'L1') {
|
|
54
57
|
warnings.push('I18N: L1 achieved (card + readme). Recommended: L2 overlay for publishable grade.');
|
|
55
58
|
}
|
|
56
59
|
for (const issue of govResult.issues) {
|
|
@@ -167,7 +170,7 @@ function buildResult(grade, blocking, warnings, project, detail = {}) {
|
|
|
167
170
|
next_step: grade === 'draft_grade' ? 'Lock at least 3 axioms with boundaries and 50% Feynman.' :
|
|
168
171
|
grade === 'human_controlled' ? 'Add 5+ rated evals and 3+ self-checks.' :
|
|
169
172
|
grade === 'tested_grade' ? 'Add 10+ evals, complete Feynman on all axioms/misunderstandings, resolve all blocking issues.' :
|
|
170
|
-
'Ready for Studio compile/export.
|
|
173
|
+
'Ready for Studio compile/export. Validate the resulting .kdna with kdna validate, plan with kdna plan-load, then load only when loadable.',
|
|
171
174
|
};
|
|
172
175
|
}
|
|
173
176
|
|