@aikdna/kdna-studio-cli 0.10.2 → 0.11.0
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 +146 -36
- package/bin/kdna-studio.js +474 -351
- package/docs/CREATION_COMMAND_CONTRACT.md +235 -0
- package/docs/TERMINAL_AGENT_CREATION.md +219 -0
- package/package.json +13 -5
- package/src/ai/distill.js +21 -2
- package/src/ai/index.js +1 -3
- package/src/ai/interview.js +28 -2
- package/src/application-host.js +561 -0
- package/src/creation-cli.js +7721 -0
- package/src/llm/config.js +16 -3
- package/src/llm/index.js +3 -3
- package/src/llm/providers/anthropic.js +8 -7
- package/src/llm/providers/openai.js +8 -7
- package/src/llm/transport.js +196 -0
- package/src/ai/feynman.js +0 -120
- package/src/ai/testlab.js +0 -73
package/README.md
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
# @aikdna/kdna-studio-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Status:** Pre-release authoring toolchain. This repository contains the
|
|
4
|
+
> unreleased `0.11.0` corrective candidate; the published incumbent remains
|
|
5
|
+
> `0.10.2`. Candidate behavior must not be described as already published.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Official terminal entry for KDNA judgment asset creation. The default Creation
|
|
8
|
+
Engine guides a user or terminal Agent from purpose and source material through
|
|
9
|
+
judgment review, boundary examples, confirmation, repair, a managed test
|
|
10
|
+
candidate, and final exact-byte delivery. It does not require the Studio app
|
|
11
|
+
or manual `.kdna` format editing.
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
Two creation paths remain useful: interview-first (articulate judgment
|
|
14
|
+
directly) and material-first (provide content, find the patterns, review what
|
|
15
|
+
belongs in scope).
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
Distillation-first authoring is domain-first: declare the target domain, owner scope, granularity, task scope, include areas, exclude areas, and load condition before extracting candidates. A single `.kdna` should stay scoped. Any future multi-asset use requires an explicit, separately admitted Host contract; it is not an implicit Studio export behavior.
|
|
18
|
+
|
|
19
|
+
This package provides the `kdna-studio` command. Its default Agent surface
|
|
20
|
+
speaks in purpose, material, judgment, boundary, example, confirmation, and
|
|
21
|
+
export terms. The existing project, evidence, candidate, and card commands
|
|
22
|
+
remain available as an expert authoring surface.
|
|
13
23
|
|
|
14
24
|
It is intentionally separate from `@aikdna/kdna-cli`:
|
|
15
25
|
|
|
@@ -22,11 +32,80 @@ It is intentionally separate from `@aikdna/kdna-cli`:
|
|
|
22
32
|
## Install
|
|
23
33
|
|
|
24
34
|
```bash
|
|
25
|
-
npm install -g @aikdna/kdna-studio-cli
|
|
35
|
+
npm install -g @aikdna/kdna-studio-cli@0.10.2
|
|
26
36
|
```
|
|
27
37
|
|
|
38
|
+
That command installs the published incumbent. To assess the unreleased
|
|
39
|
+
`0.11.0` candidate, use this source repository and its exact candidate
|
|
40
|
+
dependency coordinates; do not mix candidate documentation with npm `latest`.
|
|
41
|
+
|
|
28
42
|
## Usage
|
|
29
43
|
|
|
44
|
+
For a terminal Agent, start with the user's ordinary-language goal and an
|
|
45
|
+
optional explicit material path. The Host translates that request into private
|
|
46
|
+
machine input and generates stable technical coordinates. A normal user never
|
|
47
|
+
supplies a mode enum, Agent ID, operation ID, digest, schema, signing key,
|
|
48
|
+
receipt, seed, or benchmark coordinate.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Stable public machine templates; do not inspect package source for shapes.
|
|
52
|
+
kdna-studio guide-agent --action create --json
|
|
53
|
+
# For every command below, the Host streams its private JSON/text request to
|
|
54
|
+
# stdin from memory. Private purpose, answers and judgments are not ordinary
|
|
55
|
+
# project files and never go in argv.
|
|
56
|
+
kdna-studio create-agent my_creation --input-stdin
|
|
57
|
+
kdna-studio inventory-agent my_creation --material ./notes.md \
|
|
58
|
+
--input-stdin --json
|
|
59
|
+
# After exact inventory/policy approval, deliver only the accepted source.
|
|
60
|
+
private_material_file="$(mktemp)"
|
|
61
|
+
chmod 600 "$private_material_file"
|
|
62
|
+
trap 'rm -f "$private_material_file"' EXIT INT TERM
|
|
63
|
+
kdna-studio deliver-material my_creation \
|
|
64
|
+
--input-stdin \
|
|
65
|
+
--private-output-file "$private_material_file" --json
|
|
66
|
+
kdna-studio guide-agent my_creation --json
|
|
67
|
+
kdna-studio resume my_creation --json
|
|
68
|
+
kdna-studio status my_creation --json
|
|
69
|
+
kdna-studio answer my_creation --input-stdin
|
|
70
|
+
kdna-studio review my_creation --input-stdin
|
|
71
|
+
kdna-studio try my_creation --input-stdin
|
|
72
|
+
kdna-studio repair my_creation --input-stdin
|
|
73
|
+
kdna-studio export-agent my_creation --json
|
|
74
|
+
# Only after all three gates bind the same exact managed candidate:
|
|
75
|
+
kdna-studio finalize-agent my_creation --out dist/my_creation.kdna --json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For an approved named remote processor, the Host reads the mode-0600 temporary
|
|
79
|
+
file into that named model context and deletes it in `finally`. A dedicated
|
|
80
|
+
adapter may use fd 3 instead. This is Host-declared remote processing under the
|
|
81
|
+
named provider retention boundary; it is not verified-local or a claim that
|
|
82
|
+
model input is log-free. The generic CLI fails closed when separately attested
|
|
83
|
+
local processing is required.
|
|
84
|
+
|
|
85
|
+
The machine API uses a Host-generated, caller-stable operation coordinate.
|
|
86
|
+
Exact retry is inert while its semantic coordinate remains current; stale
|
|
87
|
+
semantic replay and changed input, material bytes, output path, or protection
|
|
88
|
+
mode fail closed. This is a Host automation contract, not a user prompt.
|
|
89
|
+
|
|
90
|
+
`status` reports the next unresolved decision plus the separate
|
|
91
|
+
`JUDGMENT_ACCEPTED`, `FORMAT_VALID`, and `APPLICATION_VERIFIED` gates.
|
|
92
|
+
`compile_ready` is only readiness to build a managed candidate. `export-agent`
|
|
93
|
+
can establish the exact-byte format gate but never writes an incomplete
|
|
94
|
+
candidate to the user's final path. Later official Host orchestration freezes
|
|
95
|
+
the `application-adoption-fidelity` plan, loads the exact managed bytes in a
|
|
96
|
+
fresh Consumer context, and obtains independent evaluation and scenario-local
|
|
97
|
+
stability evidence. The ordinary user does not assemble role keys, signatures,
|
|
98
|
+
plans, or receipts.
|
|
99
|
+
|
|
100
|
+
The machine-readable envelope exposes private Creation vocabulary and recovery
|
|
101
|
+
coordinates needed for another Agent to resume. It is not ordinary log
|
|
102
|
+
content. It does not return source bodies, absolute source paths, passwords,
|
|
103
|
+
decrypted payloads, or private keys. See
|
|
104
|
+
[Terminal Agent Creation](docs/TERMINAL_AGENT_CREATION.md) and the
|
|
105
|
+
[command contract](docs/CREATION_COMMAND_CONTRACT.md).
|
|
106
|
+
|
|
107
|
+
The expert authoring surface remains available:
|
|
108
|
+
|
|
30
109
|
```bash
|
|
31
110
|
kdna-studio create my_domain --name @yourscope/my_domain
|
|
32
111
|
kdna-studio import my_domain ./notes.md
|
|
@@ -74,47 +153,73 @@ kdna load dist/my_domain.kdna --profile=compact --as=prompt
|
|
|
74
153
|
runtime control plane for inspecting, validating, packing, unpacking, and
|
|
75
154
|
loading existing `.kdna` assets.
|
|
76
155
|
|
|
77
|
-
##
|
|
156
|
+
## First small asset
|
|
78
157
|
|
|
79
|
-
|
|
158
|
+
Tell a compatible terminal Agent:
|
|
80
159
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
160
|
+
> Create a KDNA that keeps new titles to eight words or fewer. Use
|
|
161
|
+
> `./title-notes.md`. This current remote terminal Host may process that exact
|
|
162
|
+
> file under its named provider retention policy.
|
|
163
|
+
> Save the result as an ordinary local file, but do not publish or share it.
|
|
84
164
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
--field confidence='high' \
|
|
94
|
-
--field evidence_type='practice'
|
|
165
|
+
The Agent chooses the private machine fields, previews material without
|
|
166
|
+
reading it, binds the exact preview when it matches the user's stated
|
|
167
|
+
authorization, and shows the next meaningful semantic decision. It asks again
|
|
168
|
+
only for an unexpected scope, sensitive item, coverage gap, destination
|
|
169
|
+
change, or genuine ambiguity. One material file, one complete Judgment Unit,
|
|
170
|
+
no relation, and no correction can be sufficient. Zero-material
|
|
171
|
+
interview-first work, small collections, and paged large collections use the
|
|
172
|
+
same state machine; file count is not an acceptance score.
|
|
95
173
|
|
|
96
|
-
|
|
97
|
-
|
|
174
|
+
Verified local-only processing is available only through a separately trusted
|
|
175
|
+
local Host adapter. A remote terminal Host must fail before reading when the
|
|
176
|
+
user requires verified-local handling; fd 3 or a caller-supplied digest cannot
|
|
177
|
+
upgrade remote processing into a locality proof.
|
|
98
178
|
|
|
99
|
-
|
|
100
|
-
|
|
179
|
+
A review can confirm `reviewed-no-change`. Highest question, worldview, value
|
|
180
|
+
order, priority, exception, conflict, and other complex structures appear only
|
|
181
|
+
when the actual asset needs them.
|
|
101
182
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
183
|
+
An explicitly approved material source can also be a current packaged `.kdna`.
|
|
184
|
+
It is validated,
|
|
185
|
+
authorized-loaded, Studio-reimported, and converted into reviewable derivation
|
|
186
|
+
candidates without copying its raw payload into the workspace. Protected
|
|
187
|
+
source assets use `--password-stdin`. Directory shape alone does not declare
|
|
188
|
+
material historical, current, migrated, owned, or authoritative; every source
|
|
189
|
+
starts with an honest unknown/review state.
|
|
105
190
|
|
|
106
|
-
The
|
|
107
|
-
|
|
108
|
-
return a structured but unsynthesised result. To enable real evaluation:
|
|
191
|
+
The expert `distill --ai` and `interview` commands can use a configured model
|
|
192
|
+
provider:
|
|
109
193
|
|
|
110
194
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
195
|
+
printf '%s\n' "$KDNA_LLM_API_KEY" | \
|
|
196
|
+
kdna-studio llm config --provider openai --model gpt-4 --key-pipe
|
|
197
|
+
# Provider/model/key environment variables can also configure a one-shot run.
|
|
113
198
|
```
|
|
114
199
|
|
|
200
|
+
External AI providers must use a canonical HTTPS base URL. Plain HTTP is
|
|
201
|
+
accepted only for local development at the exact numeric loopback hosts
|
|
202
|
+
`127.0.0.1` or `[::1]`; `localhost`, LAN addresses, URL credentials, query
|
|
203
|
+
strings, and fragments are rejected. Provider redirects are not followed with
|
|
204
|
+
API keys or authoring material, and provider response bodies are not copied
|
|
205
|
+
into CLI errors.
|
|
206
|
+
|
|
207
|
+
The Creation Engine `try` command records semantic examples and their reviewed
|
|
208
|
+
results; it is separate from the retired Test Lab UI. Test Lab and Feynman
|
|
209
|
+
workshop implementations remain in the source repository
|
|
210
|
+
for research and regression coverage. Published releases up to and including
|
|
211
|
+
0.10.2 shipped them as CLI commands in the npm tarball; the current
|
|
212
|
+
development line removes them from the default CLI and from the npm release
|
|
213
|
+
tarball, effective with the next release after 0.10.2. The public CLI
|
|
214
|
+
contract remains the create, review, compile, and export path shown above.
|
|
215
|
+
|
|
115
216
|
## Runtime Export Contract
|
|
116
217
|
|
|
117
|
-
`kdna-studio export`
|
|
218
|
+
`kdna-studio export-agent` creates the managed candidate and may establish its
|
|
219
|
+
exact-byte `FORMAT_VALID` result. It is not Creation Accepted or
|
|
220
|
+
`CREATION_COMPLETE`; final delivery remains blocked until all three gates bind
|
|
221
|
+
that same candidate.
|
|
222
|
+
`kdna-studio export` remains the expert Studio-project export path. Both use
|
|
118
223
|
`@aikdna/kdna-studio-core` to compile the Studio project into the current KDNA
|
|
119
224
|
runtime asset and then packs it with `@aikdna/kdna-core`.
|
|
120
225
|
|
|
@@ -156,6 +261,11 @@ kdna-studio identity init --name "Your Name"
|
|
|
156
261
|
kdna-studio identity show
|
|
157
262
|
```
|
|
158
263
|
|
|
264
|
+
A configured machine-local identity is not inherited by `create` or `migrate`.
|
|
265
|
+
Use `--use-local-identity` only when that identity is intentionally the creator
|
|
266
|
+
for the current work. Signing and identity-management commands continue to
|
|
267
|
+
load identity explicitly.
|
|
268
|
+
|
|
159
269
|
## Import from existing KDNA or legacy folders
|
|
160
270
|
|
|
161
271
|
```bash
|