@aikdna/kdna-studio-cli 0.11.0 → 0.13.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 CHANGED
@@ -1,294 +1,69 @@
1
- # @aikdna/kdna-studio-cli
1
+ # KDNA Studio CLI — typed current creation
2
2
 
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.
3
+ Studio CLI `0.13.0` consumes Studio Core `4.0.0`, Core `0.37.2` and Read `0.11.3`. Ordinary prose and supported mechanism structures share container `0.5.0` / Read grammar `0.6.4`. Core/Read package versions identify implementation bytes and do not establish interchange with NativeSections container `0.6.0` / Read `0.7.0`, or import/reuse of another CLI's output. Installation acceptance is a separate Host decision; exact content checks do not authenticate a provider process.
6
4
 
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.
5
+ An external Agent records materials and proposes judgment groups with at least two meaningful alternatives. Selection and final adoption arrive through a separately owned live channel. Human-declared review and expressly delegated Agent editorial adoption are distinct modes:
12
6
 
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).
16
-
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.
23
-
24
- It is intentionally separate from `@aikdna/kdna-cli`:
25
-
26
- | Package | Command | Role |
27
- | --- | --- | --- |
28
- | `@aikdna/kdna-cli` | `kdna` | Runtime CLI: inspect, validate, plan-load, load, pack, and unpack `.kdna` assets |
29
- | `@aikdna/kdna-studio-cli` | `kdna-studio` | Authoring CLI: create, review, compile, and export `.kdna` files |
30
- | `@aikdna/kdna-studio-core` | none | Studio SDK/compiler kernel used by apps and this CLI |
31
-
32
- ## Install
33
-
34
- ```bash
35
- npm install -g @aikdna/kdna-studio-cli@0.10.2
7
+ ```text
8
+ kdna-studio session --text ./notes.md --out ./new-export --human-fd 3
9
+ kdna-studio session --text ./notes.md --out ./new-export --agent-adoption-fd 3 --delegation-record ./delegation.json
36
10
  ```
37
11
 
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
-
42
- ## Usage
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
- ```
12
+ The second mode requires an explicitly supplied JSON record `{ "coordinate": "…", "statement": "…" }` describing existing authorization. It records the Agent as an Agent. A descriptor, transcript or authorization statement is not an identity credential. Without a supplied fd, human mode uses the controlling terminal. `--synthetic-fixture` labels implementation fixtures; executing a test callback is not actual editorial adoption.
77
13
 
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.
14
+ Only explicitly named ordinary UTF-8 `.txt`, `.md` and `.text` materials are opened. The private stdin/stdout Agent pipe carries operations, actual reply tickets and material bodies. The separate channel carries natural-language replies. The CLI supplies no model, remote service, automatic provider or global binary fallback.
84
15
 
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.
16
+ Follow brief → materials → distinct alternatives → actual selection → complete current preview → fresh final adoption → export. Typed `method` is optional. Its absence, undeclared own arrays and explicit empty arrays remain distinct. Component structures use the shared Core grammar. Candidate-specific criteria stay inside their respective candidates; an empty overall formation condition set is not filled from branch conditions.
89
17
 
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.
18
+ Export exclusively creates a new private directory. It writes exact Studio bytes and evidence, captures the saved asset again, calls Studio `completeSave`, writes `verification.json`, and writes version-2 `complete.json` last. Files and directory become read-only for their owner. Failure removes only the incomplete reservation made by that invocation. Library saving reports `accepted_with_live_context`, scoped to the actual process and saved-byte check. It does not prove storage durability, person identity or action authorization.
99
19
 
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
-
109
- ```bash
110
- kdna-studio create my_domain --name @yourscope/my_domain
111
- kdna-studio import my_domain ./notes.md
112
- kdna-studio target declare my_domain \
113
- --category expression_writing \
114
- --scope personal \
115
- --granularity core_principles \
116
- --task "longform article review" \
117
- --include "argument structure,tone,revision" \
118
- --exclude "life habits,food preference"
119
- kdna-studio source my_domain
120
- kdna-studio distill my_domain --candidates candidates.json
121
- kdna-studio candidate list my_domain
122
- kdna-studio candidate accept my_domain <candidate-id>
123
- kdna-studio candidate promote my_domain
124
- kdna-studio card add my_domain axiom \
125
- --field one_sentence="Prefer specific evidence over broad claims" \
126
- --field full_statement="When reviewing content, prefer specific evidence over broad claims because unsupported generalizations make the judgment impossible to verify or improve." \
127
- --field why="Broad claims hide the actual reason for a judgment, so reviewers cannot tell whether the conclusion is evidence based, reusable, or merely plausible sounding." \
128
- --field applies_when='["reviewing content"]' \
129
- --field does_not_apply_when='["pure formatting"]' \
130
- --field failure_risk="generic advice" \
131
- --field confidence='high' \
132
- --field evidence_type='practice'
133
- # Optional: record review provenance
134
- kdna-studio card approve my_domain --all --by expert --statement "I confirm this judgment."
135
- kdna-studio export my_domain --out dist/my_domain.kdna
20
+ ```text
21
+ kdna-studio verify --bundle ./new-export
22
+ kdna-studio read --bundle ./new-export --allow-read --judgment 1
136
23
  ```
137
24
 
138
- Candidate promotion is scope-gated: only candidates with `status == accepted` and `scope_fit == true` are promoted to cards by default. Use `kdna-studio candidate override <project> <candidate-id>` only when a human intentionally overrides the scope gate.
25
+ Static reopening keeps `creation_accepted:not_evaluated` and `live_context:unavailable`; JSON cannot restore a one-use capability. `read` requires explicit `--allow-read`, delegates request admission, scope, exact selection and byte budgets to public Read, and grants no action authority. Format1, format-absent legacy evidence and old completion sidecars are noncurrent. Preserve their original accepted releases; never relabel them to this graph.
139
26
 
140
- The Studio CLI exports complete, non-deprecated cards. Human Lock and other
141
- provenance records are optional review evidence, not creation permission or
142
- format-validity requirements.
27
+ The full 12-package dependency graph uses exact registry coordinates and an integrity lock; the committed vendor archives anchor its member receipt. Before loading upstream code or materials, the CLI checks complete installed member sets, bytes, versions and one shared Core resolution, and rejects unbound optional addons. The exact archive/member declarations are in `src/public-bindings.json`.
143
28
 
144
- After export, use the runtime CLI:
29
+ Install with registry access using the locked coordinates:
145
30
 
146
- ```bash
147
- kdna validate dist/my_domain.kdna --runtime
148
- kdna plan-load dist/my_domain.kdna --json
149
- kdna load dist/my_domain.kdna --profile=compact --as=prompt
31
+ ```text
32
+ npm ci --ignore-scripts --omit=optional --no-audit --no-fund
33
+ npm test
34
+ npm run lint
35
+ npm pack --offline --ignore-scripts
150
36
  ```
151
37
 
152
- `kdna-studio` is the CLI entry for Studio project authoring. `kdna` is the
153
- runtime control plane for inspecting, validating, packing, unpacking, and
154
- loading existing `.kdna` assets.
155
-
156
- ## First small asset
157
-
158
- Tell a compatible terminal Agent:
159
-
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.
38
+ For an offline install, add `--offline` to `npm ci` only after the npm cache contains every required locked artifact with its matching integrity. The committed `vendor/` archives alone neither populate that cache nor redirect the registry URLs in the lock.
164
39
 
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.
40
+ An embedding that requires offline processing must independently deny network access; npm `--offline` alone is not a network boundary. No package lifecycle scripts or native optional packages are needed for this graph.
173
41
 
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.
42
+ ## Dependency coordinates and publication
178
43
 
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.
182
-
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.
190
-
191
- The expert `distill --ai` and `interview` commands can use a configured model
192
- provider:
193
-
194
- ```bash
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.
198
- ```
44
+ The current package and lock use exact registry versions. Runtime packages belong in `dependencies`, and `overrides` bind their required peers to the same root coordinates. Integrity-locked `file:` coordinates used by local candidate/test fixtures are separate from this registry installation graph.
199
45
 
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.
46
+ `npm run check:publish-coordinates` rejects local dependency declarations in a publishable package, because a registry consumer has no repository `vendor/` directory next to the packed artifact. The publish workflow runs that gate and requires the registry to serve the exact locked dependency integrities.
206
47
 
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
-
216
- ## Runtime Export Contract
217
-
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
223
- `@aikdna/kdna-studio-core` to compile the Studio project into the current KDNA
224
- runtime asset and then packs it with `@aikdna/kdna-core`.
225
-
226
- A KDNA runtime export contains only these top-level entries:
227
-
228
- - `mimetype`
229
- - `kdna.json`
230
- - `payload.kdnab`
231
- - `checksums.json`
232
-
233
- The current producer writes `format_version: 0.1.0`, payload profile
234
- `kdna.payload.judgment` with `profile_version: 0.1.0`, and digest profile
235
- `kdna.digest-basis.runtime-entry-set` with `digest_profile_version: 0.1.0`.
236
- These compatibility coordinates are independent of package versions.
237
-
238
- Authoring/source entries such as `KDNA_Core.json`, `KDNA_Patterns.json`, and
239
- `source_cards` are not runtime distribution entries. They may exist in Studio
240
- compile output or legacy imports, but they must not be emitted by the runtime
241
- export path.
242
-
243
- Being part of the official toolchain means this package is maintained by the
244
- KDNA project. It does not make any specific asset endorsed or suitable for
245
- every use case.
246
-
247
- ## Consumption sidecars
248
-
249
- Studio can export route-card and consumer-index drafts for applications that
250
- use the consumption runtime. These files are separate from the `.kdna` export
251
- and are disabled by default. They are review inputs, not claims that an asset
252
- is automatically suitable for a task or ready for a production runtime.
253
-
254
- Use the KDNA CLI review and evaluation commands before an application enables
255
- a sidecar entry.
256
-
257
- ## Identity
258
-
259
- ```bash
260
- kdna-studio identity init --name "Your Name"
261
- kdna-studio identity show
262
- ```
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
-
269
- ## Import from existing KDNA or legacy folders
270
-
271
- ```bash
272
- # Fork an existing canonical .kdna asset (cards are imported as draft)
273
- kdna-studio create forked --from-kdna ./parent.kdna --name @scope/forked
274
-
275
- # Migrate a legacy JSON source folder
276
- kdna-studio create migrated --from-folder ./old-domain-json --name @scope/migrated
277
- ```
48
+ See [command contract](docs/CREATION_COMMAND_CONTRACT.md) and [Agent integration](docs/TERMINAL_AGENT_CREATION.md). Their JSONL is private transport, not a KDNA asset format. Historical project/card commands and runtime adapters stay outside the packed and default surface.
278
49
 
279
- Current `.kdna` imports also preserve explicitly declared `highest_question`,
280
- `worldview`, ordered `value_order`, and `judgment_role` values in the editable
281
- project. Re-export writes those values back exactly; Studio does not infer a
282
- replacement judgment core from an axiom.
283
50
 
284
- Imports preserve authored source references, `core_structure` relations,
285
- pattern subtypes, scenario and case metadata, extended reasoning fields, and
286
- source-authored evolution. Studio-only card state and lock audit records remain
287
- authoring provenance and are not rewritten as Runtime judgment evolution.
51
+ ## Source and release verification
288
52
 
289
- ## Related
53
+ The dependency graph binds Studio Core `4.0.0`, Core `0.37.2`, Read
54
+ `0.11.3` and `fast-uri` `3.1.8`. The current source ledger is
55
+ `fixtures/runtime-candidates/current-sources.json`; `npm run verify:candidate-sources`
56
+ rebuilds its exact Git package trees and compares every installed tar member.
57
+ `npm run check:current-bindings` independently recomputes the complete dependency
58
+ member receipt. These checks execute for the current graph; historical
59
+ registry fixtures and their retired API remain separate test material.
290
60
 
291
- - [KDNA Core](https://github.com/aikdna/kdna) — Official format specification
292
- - [kdna-cli](https://github.com/aikdna/kdna-cli) — runtime CLI for inspect, validate, pack, unpack, and load
293
- - [kdna-studio-core](https://github.com/aikdna/kdna-studio-core) — authoring SDK used by this CLI
294
- - [kdna-studio-swift](https://github.com/aikdna/kdna-studio-swift) — native Swift counterpart
61
+ In the stable release context, `npm run release:generate-evidence -- --out
62
+ <outside-repository-evidence.json> --artifact <outside-repository-package.tgz>`
63
+ creates two byte-identical packs from exact committed blobs and validates their
64
+ independently parsed contents. It requires a clean checkout, the exact version
65
+ tag and the matching release commit. The stable publisher also requires a
66
+ published, non-draft, non-prerelease event and exact registry dependency
67
+ integrities. Prerelease evidence cannot enter that publisher. Local checks do
68
+ not establish registry availability, verified editorial identity, real human
69
+ acceptance or permission to publish.