@aikdna/kdna-studio-cli 0.10.2 → 0.13.0-rc.components.2

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,184 +1,64 @@
1
- # @aikdna/kdna-studio-cli
1
+ # KDNA Studio CLI — typed current creation
2
2
 
3
- Official Studio command-line entry for KDNA judgment asset creation — turns your notes, documents, works, and feedback into loadable `.kdna` files.
3
+ The terminal Host consumes Studio 4.0.0-rc.components.2, Core 0.37.1-rc.browser.1 and Read 0.11.2-rc.browser.1. 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.
4
4
 
5
- Two authoring paths: interview-first (articulate judgment directly) and distillation-first (provide content, find the patterns, review what belongs in scope).
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:
6
6
 
7
- 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; complex work should compose multiple domain assets through a KDNA Cluster.
8
-
9
- This package provides the `kdna-studio` command. It creates Studio projects,
10
- imports evidence, manages judgment cards, records optional review/provenance
11
- signals, compiles project content, and exports canonical `.kdna`
12
- assets with build reports.
13
-
14
- It is intentionally separate from `@aikdna/kdna-cli`:
15
-
16
- | Package | Command | Role |
17
- | --- | --- | --- |
18
- | `@aikdna/kdna-cli` | `kdna` | Runtime CLI: inspect, validate, plan-load, load, pack, and unpack `.kdna` assets |
19
- | `@aikdna/kdna-studio-cli` | `kdna-studio` | Authoring CLI: create, review, compile, and export `.kdna` files |
20
- | `@aikdna/kdna-studio-core` | none | Studio SDK/compiler kernel used by apps and this CLI |
21
-
22
- ## Install
23
-
24
- ```bash
25
- npm install -g @aikdna/kdna-studio-cli
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
26
10
  ```
27
11
 
28
- ## Usage
29
-
30
- ```bash
31
- kdna-studio create my_domain --name @yourscope/my_domain
32
- kdna-studio import my_domain ./notes.md
33
- kdna-studio target declare my_domain \
34
- --category expression_writing \
35
- --scope personal \
36
- --granularity core_principles \
37
- --task "longform article review" \
38
- --include "argument structure,tone,revision" \
39
- --exclude "life habits,food preference"
40
- kdna-studio source my_domain
41
- kdna-studio distill my_domain --candidates candidates.json
42
- kdna-studio candidate list my_domain
43
- kdna-studio candidate accept my_domain <candidate-id>
44
- kdna-studio candidate promote my_domain
45
- kdna-studio card add my_domain axiom \
46
- --field one_sentence="Prefer specific evidence over broad claims" \
47
- --field full_statement="When reviewing content, prefer specific evidence over broad claims because unsupported generalizations make the judgment impossible to verify or improve." \
48
- --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." \
49
- --field applies_when='["reviewing content"]' \
50
- --field does_not_apply_when='["pure formatting"]' \
51
- --field failure_risk="generic advice" \
52
- --field confidence='high' \
53
- --field evidence_type='practice'
54
- # Optional: record review provenance
55
- kdna-studio card approve my_domain --all --by expert --statement "I confirm this judgment."
56
- kdna-studio export my_domain --out dist/my_domain.kdna
57
- ```
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.
58
13
 
59
- 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.
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.
60
15
 
61
- The Studio CLI exports complete, non-deprecated cards. Human Lock and other
62
- provenance records are optional review evidence, not creation permission or
63
- format-validity requirements.
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.
64
17
 
65
- After export, use the runtime CLI:
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.
66
19
 
67
- ```bash
68
- kdna validate dist/my_domain.kdna --runtime
69
- kdna plan-load dist/my_domain.kdna --json
70
- kdna load dist/my_domain.kdna --profile=compact --as=prompt
20
+ ```text
21
+ kdna-studio verify --bundle ./new-export
22
+ kdna-studio read --bundle ./new-export --allow-read --judgment 1
71
23
  ```
72
24
 
73
- `kdna-studio` is the CLI entry for Studio project authoring. `kdna` is the
74
- runtime control plane for inspecting, validating, packing, unpacking, and
75
- loading existing `.kdna` assets.
76
-
77
- ## 5-minute first asset
78
-
79
- If you just installed and want to ship a KDNA asset without an LLM:
80
-
81
- ```bash
82
- # 1. Create a project
83
- kdna-studio create my_domain --name @yourscope/my_domain
84
-
85
- # 2. Add at least one judgment card
86
- kdna-studio card add my_domain axiom \
87
- --field one_sentence='specific evidence outranks broad claims' \
88
- --field full_statement='Always cite the specific source that supports a judgment; broad claims without evidence are the most common cause of bad agent advice.' \
89
- --field why='because vague advice fails in production' \
90
- --field applies_when='["reviewing"]' \
91
- --field does_not_apply_when='["formatting"]' \
92
- --field failure_risk='praise without diagnosis' \
93
- --field confidence='high' \
94
- --field evidence_type='practice'
95
-
96
- # 3. Optional: approve and record Human Lock provenance
97
- kdna-studio card approve my_domain --all --by me --statement "i confirm"
98
-
99
- # 4. Export the asset
100
- kdna-studio export my_domain --out my_domain.kdna
101
-
102
- # 5. Verify with the runtime CLI
103
- kdna load my_domain.kdna --profile=compact
104
- ```
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.
105
26
 
106
- The first three AI commands (feynman, distill --ai, test, interview) work
107
- without `KDNA_LLM_PROVIDER` / `KDNA_LLM_API_KEY` by passing `--no-llm`. They
108
- return a structured but unsynthesised result. To enable real evaluation:
27
+ The full 12-package local `file:vendor` graph and SRI lock are supplied. 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`.
109
28
 
110
- ```bash
111
- kdna-studio llm config --provider openai --model gpt-4 --key <your-key>
112
- # or set KDNA_LLM_PROVIDER, KDNA_LLM_API_KEY, KDNA_LLM_MODEL
29
+ ```text
30
+ npm ci --offline --ignore-scripts --omit=optional --no-audit --no-fund
31
+ npm test
32
+ npm run lint
33
+ npm pack --offline --ignore-scripts
113
34
  ```
114
35
 
115
- ## Runtime Export Contract
116
-
117
- `kdna-studio export` is the canonical runtime export path. It uses
118
- `@aikdna/kdna-studio-core` to compile the Studio project into the current KDNA
119
- runtime asset and then packs it with `@aikdna/kdna-core`.
120
-
121
- A KDNA runtime export contains only these top-level entries:
122
-
123
- - `mimetype`
124
- - `kdna.json`
125
- - `payload.kdnab`
126
- - `checksums.json`
127
-
128
- The current producer writes `format_version: 0.1.0`, payload profile
129
- `kdna.payload.judgment` with `profile_version: 0.1.0`, and digest profile
130
- `kdna.digest-basis.runtime-entry-set` with `digest_profile_version: 0.1.0`.
131
- These compatibility coordinates are independent of package versions.
132
-
133
- Authoring/source entries such as `KDNA_Core.json`, `KDNA_Patterns.json`, and
134
- `source_cards` are not runtime distribution entries. They may exist in Studio
135
- compile output or legacy imports, but they must not be emitted by the runtime
136
- export path.
137
-
138
- Being part of the official toolchain means this package is maintained by the
139
- KDNA project. It does not make any specific asset endorsed or suitable for
140
- every use case.
36
+ 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.
141
37
 
142
- ## Consumption sidecars
38
+ ## Dependency coordinates and publication
143
39
 
144
- Studio can export route-card and consumer-index drafts for applications that
145
- use the consumption runtime. These files are separate from the `.kdna` export
146
- and are disabled by default. They are review inputs, not claims that an asset
147
- is automatically suitable for a task or ready for a production runtime.
40
+ A direct declaration is either an exact SemVer or an integrity-locked `file:` coordinate. Placement follows what the documented entry needs: these `file:` coordinates belong in `dependencies`, because `npm ci --omit=dev --omit=optional` followed by `npm test` still works with the development graph omitted, whereas a `devDependencies` placement would not survive `--omit=dev`. Peers declared by vendored members are bound to this repository's own coordinates through `overrides`, so an unreadable vendor archive fails locally instead of sending npm to the registry.
148
41
 
149
- Use the KDNA CLI review and evaluation commands before an application enables
150
- a sidecar entry.
42
+ Before publishing a release from this repository every `file:` coordinate must be replaced by the **exact registry version**, because a consumer that installs the packed artifact from a registry has no `vendor/` directory next to it. `npm run check:publish-coordinates` reports the coordinates that are still local; the publish workflow runs that gate before a package can be pushed.
151
43
 
152
- ## Identity
153
-
154
- ```bash
155
- kdna-studio identity init --name "Your Name"
156
- kdna-studio identity show
157
- ```
158
-
159
- ## Import from existing KDNA or legacy folders
160
-
161
- ```bash
162
- # Fork an existing canonical .kdna asset (cards are imported as draft)
163
- kdna-studio create forked --from-kdna ./parent.kdna --name @scope/forked
164
-
165
- # Migrate a legacy JSON source folder
166
- kdna-studio create migrated --from-folder ./old-domain-json --name @scope/migrated
167
- ```
44
+ 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.
168
45
 
169
- Current `.kdna` imports also preserve explicitly declared `highest_question`,
170
- `worldview`, ordered `value_order`, and `judgment_role` values in the editable
171
- project. Re-export writes those values back exactly; Studio does not infer a
172
- replacement judgment core from an axiom.
173
46
 
174
- Imports preserve authored source references, `core_structure` relations,
175
- pattern subtypes, scenario and case metadata, extended reasoning fields, and
176
- source-authored evolution. Studio-only card state and lock audit records remain
177
- authoring provenance and are not rewritten as Runtime judgment evolution.
47
+ ## Current candidate preflight
178
48
 
179
- ## Related
49
+ The checked dependency graph binds Core `0.37.1-rc.browser.1`, Read
50
+ `0.11.2-rc.browser.1` and `fast-uri` `3.1.8`. The current source ledger is
51
+ `fixtures/runtime-candidates/current-sources.json`; `npm run verify:candidate-sources`
52
+ rebuilds its exact Git package trees and compares every installed tar member.
53
+ `npm run check:current-bindings` independently recomputes the complete dependency
54
+ member receipt. These checks execute for the current candidate; historical
55
+ registry fixtures and their retired API remain separate test material.
180
56
 
181
- - [KDNA Core](https://github.com/aikdna/kdna) — Official format specification
182
- - [kdna-cli](https://github.com/aikdna/kdna-cli) — runtime CLI for inspect, validate, pack, unpack, and load
183
- - [kdna-studio-core](https://github.com/aikdna/kdna-studio-core) — authoring SDK used by this CLI
184
- - [kdna-studio-swift](https://github.com/aikdna/kdna-studio-swift) — native Swift counterpart
57
+ From a clean source checkpoint, `npm run candidate:generate-evidence -- --out
58
+ <outside-repository-evidence.json> --artifact <outside-repository-package.tgz>`
59
+ creates two byte-identical packs from exact committed blobs and validates their
60
+ independently parsed contents. Its candidate evidence schema cannot enter the
61
+ stable publisher. Candidate preflight does not establish registry availability,
62
+ verified editorial identity, real human acceptance or permission to publish.
63
+ The stable release event/tag policy and exact registry-coordinate gate remain
64
+ required before publication.