@aikdna/kdna-studio-cli 0.11.0 → 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.
@@ -1,235 +1,30 @@
1
- # Creation command contract
1
+ # Current command boundary
2
2
 
3
- Status: unreleased source-candidate machine contract. It is for Host adapter
4
- implementers, not an ordinary-user questionnaire and not a published npm
5
- compatibility promise.
3
+ Supported commands: `help`, `--help`, `--version`, `session`, `verify`, `read`. Unknown commands, repeated or unknown options fail before opening materials or output. Package exports expose metadata only; the supported executable is the bin. No deep path, alternate checkout, model, remote server or runtime fallback is selected.
6
4
 
7
- ## Command set
5
+ `session --out NEW_DIRECTORY` accepts repeated `--text FILE` and `--interview FILE`, `--synthetic-fixture`, and exactly one adoption mode. Human mode uses a controlling terminal or `--human-fd N`. Explicit delegated Agent mode requires both `--agent-adoption-fd N` and `--delegation-record FILE`. N is an integer at least 3. Human and Agent fd options cannot be combined. `session` additionally accepts `--password-fd N` (N an integer at least 3, distinct from the adoption fds): the password is read exactly once from that pipe fd. Password values are never accepted in process arguments, and the Agent stream is never the password channel. The delegation file contains only nonempty `coordinate` and `statement`; it is an explicit embedding claim, not an authenticated grant.
8
6
 
9
- ```text
10
- guide-agent
11
- create-agent
12
- inventory-agent
13
- deliver-material
14
- resume
15
- status
16
- answer
17
- review
18
- try
19
- repair
20
- export-agent
21
- finalize-agent
22
- ```
7
+ The child owns its inherited adoption read endpoint, a TTY, pipe or socket; a regular file cannot stand in for a live reply channel. It cancels and releases only its own endpoint on completion or abandonment. The parent owns its writer. Both Agent JSONL and adoption endpoints must remain healthy; EOF/error before export terminates the workspace and late replies cannot revive it. There is no default timeout or manufactured reply. A slow active reviewer may continue deciding.
23
8
 
24
- Each command accepts `--json`. Private structured input uses `--input-file` or
25
- `--input-stdin`. Natural-language source or judgment content, passwords, and
26
- API keys are rejected from argv. The Host generates and privately persists
27
- machine fields such as `mode`, `workflow_mode`, `created_by`, `operation_id`,
28
- revision, and digest; it must not ask the user to fill them in.
9
+ Frames are limited to 1 MiB. At most one complete next frame plus a bounded partial frame is held while an operation is pending; excess pipelining rejects `CLI_INPUT_QUEUE_LIMIT`. Each request id is unique; each interpretation names the one live reply ticket. Reuse or another operation during review rejects. Already-completed synchronous export is not undone by a later EOF.
29
10
 
30
- `guide-agent --action create` returns the current public create template.
31
- `guide-agent <workspace>` returns the exact next action and supported machine
32
- template. A Host must not inspect installed package source or private workspace
33
- JSON to reconstruct an undocumented action. If the guide reports an
34
- action-specific template or official adapter gap, that gap is a product
35
- blocker rather than permission to hand-compose internal receipts.
11
+ `verify --bundle DIRECTORY` captures actual bytes, admits them with Core, requires the current private completion marker, and delegates evidence verification to Studio. `read --bundle DIRECTORY [--allow-read] [--judgment N] [--budget BYTES]` first admits its formal Read request, then verifies the current bundle, then invokes public Read. Invalid budgets reject before bundle I/O. Invalid Core bytes or evidence prevent later disclosure; a consistent bundle still needs explicit read permission. Catalog ordinal selection is Host navigation; closure and projection remain in Read.
36
12
 
37
- ## Result envelope
13
+ Private bundles contain `asset.kdna`, `creation-evidence.json`, `binding.json`, `verification.json`, and `complete.json`. The latter is `{kind:'private-studio-export-bundle',version:2}`, carrying a `protection` block when the export was protected. In a protected export the saved-byte completion still runs on the unprotected bytes, but only in an isolated transient area that is removed with the invocation: plaintext never appears at the delivery position, and the delivered `asset.kdna` is the deterministic post-verification derivative (`verification_basis:'pre_protection_plaintext'`) - a `kdna.envelope.aead` container with a password slot (argon2id) and a recovery slot (scrypt-sha256). The recovery code is displayed exactly once on stderr and must not be retained by the host. Static `verify` and `read` do not admit protected containers; consumer-side unlocking belongs to the reader path. A failed protection fails the whole export; Studio/Core protection codes pass through unchanged, and there is no silent fallback to an unprotected bundle. Output reservation is exclusive, saved bytes are re-captured and passed to Studio `completeSave`, then completion is written last. Existing outputs are never replaced. A partial reservation is removed only by its owning invocation. Persistent import/resume, overwritten outputs, external compiler callbacks, signing services, identity verification and action execution are unsupported.
38
14
 
39
- Success returns one JSON document on stdout. Diagnostics go to stderr. The
40
- envelope includes:
15
+ Stdout is private machine JSON and may contain materials, evidence and disclosed content. Stderr contains prompts/previews or concise errors. Do not publish these streams. Errors do not echo raw frames, source paths, stacks or provider secrets. The password read is bounded (64 KiB), strictly UTF-8 with one trailing newline stripped, refuses a TTY fd, and zeroizes its buffer; empty, oversize or invalid-encoding input rejects before any bundle exists. Exit 0 denotes successful export/verification or ready Read; 2 denotes terminal, transport, operation or filesystem rejection; 3 denotes public admission, evidence or disclosure rejection.
41
16
 
42
- ```json
43
- {
44
- "document_type": "kdna.creation-command-result",
45
- "workspace": {
46
- "state": "in_progress",
47
- "semantic_revision": 1
48
- },
49
- "readiness": {
50
- "compile_ready": false,
51
- "judgment_accepted": false,
52
- "completion_gates": {
53
- "format_valid": false,
54
- "judgment_accepted": false,
55
- "application_verified": false,
56
- "creation_complete": false
57
- }
58
- },
59
- "next_action": {
60
- "action": "review_candidates",
61
- "required_actor": "creating-agent",
62
- "requires_user": false,
63
- "unresolved_ids": []
64
- }
65
- }
66
- ```
17
+ Studio format `kdna.studio-creation-evidence/2` and the exact current graph are required. The CLI does not implement another evidence canonicalizer, component interpreter or legacy branch. Static consistency cannot restore `accepted_with_live_context`: static status retains `creation_accepted:not_evaluated`, `live_context:unavailable`, `identity:not_verified` and `action_authorization:not_evaluated`. Role-specific adoption records do not authenticate a person or Agent.
67
18
 
68
- `compile_ready` is not `FORMAT_VALID`; it says only that the current judgment
69
- model may be compiled into a managed test candidate. `judgment_accepted` is the
70
- second gate, not Creation Complete. New schema output does not expose
71
- ambiguous legacy aliases.
19
+ Before executing dependencies, the Host checks every member, path set, package version, mandatory resolution and unbound optional package against `src/public-bindings.json`. Archive equality is a local content observation; installation approval and process-origin trust remain external. Tests use explicit synthetic channels and do not prove actual Agent editorial decisions or publication readiness.
72
20
 
73
- Normal command output may contain private state and therefore is not a public
74
- log payload. It never contains raw material bodies, source absolute paths,
75
- passwords, decrypted Runtime payloads, role private keys, or provider response
76
- bodies.
77
21
 
78
- ## Explicit execution and authority
22
+ ## Container support
79
23
 
80
- `workflow_mode` is `collaborative` or `autonomous`. Authority `mode` is one of:
81
-
82
- ```text
83
- agent-authored
84
- human-confirmed
85
- organization-confirmed
86
- interpretive
87
- mixed-authorship
88
- ```
89
-
90
- Human participation is a private receipt, not a sixth mode. Both fields are
91
- explicit for new workspaces; the CLI does not silently infer collaborative
92
- execution or authorship. The Host may derive a conservative proposal from the
93
- user's ordinary words, then asks only when representation or authorship is
94
- ambiguous.
95
-
96
- ## Idempotency and recovery
97
-
98
- Every mutation has a caller-stable operation coordinate generated by the Host.
99
- An exact retry at the same semantic coordinate is inert. Reusing an operation
100
- ID with different input, bytes, destination, or state fails closed.
101
-
102
- Private saves are atomic. `resume` reports the next required actor/action and
103
- restores an interrupted managed-candidate or final-delivery transaction. A
104
- fresh Host does not need previous chat context. An outdated private workspace
105
- returns a specific schema migration requirement rather than guessing a new
106
- authority.
107
-
108
- ## Material inventory
109
-
110
- `inventory-agent` accepts explicit files or directories. Before approval it
111
- does not read content and returns a public projection with:
112
-
113
- - relative display path and source kind;
114
- - `eligible`/`awaiting-approval`, excluded, unsupported, duplicate, uncertain,
115
- or failed status;
116
- - extractor/Host-observation capability;
117
- - operation batch continuation;
118
- - inventory and processing-policy digests.
119
-
120
- The processing policy explicitly binds local-only execution, a named remote
121
- processor and boundary, or prohibited processing, plus
122
- `host-declared` or `verified-host-required` assurance. A caller-supplied
123
- capability digest is only a coordinate and never proves locality. The generic
124
- CLI refuses `verified-host-required` delivery unless a separately trusted Host
125
- adapter is available. Missing policy,
126
- destination drift, file drift, workspace overlap, or a symlink escape fails
127
- closed. An input directory may contain the private workspace; the exact
128
- workspace subtree is excluded. The workspace itself or a material root inside
129
- it is rejected.
130
-
131
- `deliver-material` releases only an approved entry through one Host-owned
132
- channel. A standard named-remote terminal Host uses
133
- `--private-output-file <precreated-mode-0600-system-temp-file>` and deletes the
134
- file in `finally`; a dedicated adapter may use `--private-output-fd 3`. The two
135
- options are mutually exclusive. A regular file/fd must be Host-owned, deny
136
- group/other access, avoid symlinks, and not alias stdout/stderr. The command
137
- verifies file identity and exact bytes again and clears transient buffers. Raw
138
- content is never returned in command JSON. The Host may place those bytes into
139
- the approved named model context under its declared retention boundary. This
140
- is Host-declared remote processing, not verified-local evidence or a claim
141
- that model input is log-free.
142
-
143
- Direct text is strict UTF-8 and untruncated. PDF/word-processing extraction is
144
- capability-probed. A Host-observed image/audio/video/binary uses an exact
145
- streamed source digest plus bounded observation text and a digest-bound
146
- observer/tool/coverage record. Large source media is not buffered merely to
147
- hash it.
148
-
149
- Exact byte duplicates are deduplicated across operations and batches. Existing
150
- unchanged materials do not consume the next continuation budget. Any new,
151
- changed, deleted, or reclassified entry requires a new content-free review.
152
- Directory continuation does not imply offset continuation inside one file.
153
- One text file above the direct-processing byte limit is
154
- `single-file-chunking-not-implemented`; the caller may provide an explicitly
155
- selected, ordered, full-coverage split copy or exclude it.
156
-
157
- ## Mutation commands
158
-
159
- - `answer` requires explicit actor, subject, expected revision, and current
160
- pre-answer semantic coordinate. Question-kind disposition decides whether
161
- the issue is actually resolved; arbitrary prose does not close a conflict,
162
- source-safety, test, or application failure.
163
- - `review` records source review (including `reviewed-no-change`), candidate
164
- promotion/rejection, relation decisions, confirmation, import mapping, and
165
- bounded uncertainty disposition.
166
- - `try` freezes and records semantic or application evidence in separate
167
- ordered requests.
168
- - `repair` turns current failures into bounded repair items. A semantic repair
169
- invalidates confirmations, tests, managed candidates, and application
170
- evidence.
171
-
172
- ## Coverage and stability
173
-
174
- Semantic and application plans derive required dimensions from declared
175
- structure and risk. A simple one-unit asset may use one applicable task and one
176
- boundary/exit task. Existing high-risk or unique units, global critical
177
- boundaries, conflicts, priority, exception, or authority-precedence must be
178
- covered; absent structures are not invented.
179
-
180
- The application contract is `application-adoption-fidelity`. Each task is
181
- `with-only` or `paired-diagnostic`. Only the latter has an isolated baseline
182
- lane. No observed difference is not a failure and is not causal proof.
183
-
184
- At least one pre-frozen core or highest-risk boundary scenario supplies the
185
- repeated evidence required for stable use. Each repetition binds actual
186
- Consumer output and per-task independent evaluation, and the Engine
187
- mechanically recomputes stability. Caller-provided `stable: true`, unrelated
188
- digests, missing rounds, changed order, or altered outputs cannot pass.
189
-
190
- ## Managed candidate
191
-
192
- `export-agent` creates and verifies an exact managed test candidate inside the
193
- private workspace:
194
-
195
- ```bash
196
- kdna-studio export-agent <workspace> --json
197
- ```
198
-
199
- It takes no user `--out` path. The build receipt can establish `FORMAT_VALID`
200
- for exact bytes, including a technically valid encrypted container when the
201
- current caller lacks authorization. Actual authorized Runtime load and
202
- projection belong to `APPLICATION_VERIFIED`.
203
-
204
- The official Host, not the ordinary user, owns fresh Consumer/evaluator
205
- isolation, task delivery, signing, and receipt submission. The creating Agent
206
- cannot self-evaluate. A Host without a conforming orchestration adapter must
207
- report that blocker.
208
-
209
- ## Final delivery
210
-
211
- `finalize-agent` is available only when all three gates bind the same semantic
212
- and asset digests:
213
-
214
- ```bash
215
- kdna-studio finalize-agent <workspace> --out <file.kdna> --json
216
- ```
217
-
218
- It verifies managed bytes against build/application/completion receipts and
219
- atomically copies those exact bytes without recompiling. It rejects a target
220
- inside the workspace, path aliases, symlink escapes, stale receipts, changed
221
- bytes, and partial transactions before leaving a target. Copying already
222
- verified encrypted bytes does not request a redundant password.
223
-
224
- Runtime `access: public` is an authorization mode: anyone possessing the file
225
- can load it without an additional KDNA secret. It is not an Internet
226
- publication action. Distribution and publication are separate caller actions
227
- and are never inferred by Creation.
228
-
229
- ## Secret transport
230
-
231
- All secret-bearing stdin readers use a bounded, strict UTF-8 transport
232
- decoder. It removes at most one terminal LF or CRLF, preserves all other
233
- leading/trailing whitespace, rejects empty/oversize/invalid UTF-8 input, and
234
- clears transient buffers. Studio and Runtime must interpret the same
235
- authorized secret bytes.
24
+ Studio session output uses container `0.5.0` and Read grammar `0.6.4`.
25
+ The pinned Core/Read implementation versions also contain other public routes;
26
+ sharing their package coordinates does not establish container interchange.
27
+ NativeSections container `0.6.0` / Read `0.7.0` input, another CLI's output,
28
+ persistent import and resume are not supported by this entry. Revisions operate
29
+ on the current live Studio session before final confirmation. `verify` and
30
+ `read` consume this entry's completed bundle under the boundaries above.
@@ -1,219 +1,36 @@
1
- # Terminal Agent Creation
1
+ # Terminal Agent integration
2
2
 
3
- Status: unreleased source-candidate guide. The published package does not yet
4
- promise this flow, and a checked-in Skill is not proof that a particular Host
5
- can complete it.
3
+ The live private Agent transport creates through Studio; it is not a public asset wire format. Keep stdin/stdout private. The Agent owns substantive authoring and interpretation of actual reviewer language. The CLI has no model or keyword classifier.
6
4
 
7
- ## Start with the user's words
5
+ Use an approved exact local installation. Start with explicit source files and a new output directory. Use a separately owned fd3 for either `--human-fd 3`, or `--agent-adoption-fd 3 --delegation-record FILE` when the Agent has express editorial authority. Preserve the actual actor. A delegated Agent must never be represented as a human. An interview reads the selected live adoption channel and records question plus answer as private material.
8
6
 
9
- A normal request can be:
7
+ Each newline-terminated Agent frame has unique `id`, `op`, and `data`. Wait for a result or the live reply ticket. The first `ready` event provides the workspace and explicit materials. Material references are one-based ordinals; judgment, alternative and component references use stable local keys.
10
8
 
11
- > Create a small KDNA that keeps my new article titles to eight words or fewer.
12
- > Use `./title-notes.md`. This current remote Codex Host may process that file
13
- > under its named provider retention policy. Save the
14
- > final result as an ordinary local file; do not share or publish it.
9
+ | op | data |
10
+ | --- | --- |
11
+ | brief | `{title,scope,highest_question}`; the one authored question this judgment answers |
12
+ | interview | `{title,question}` |
13
+ | propose | `{localKey,alternatives:[alternative,alternative,...]}` |
14
+ | revise | `{localKey,baseRevision,alternatives,explanation}` |
15
+ | review | `{}`; request actual selection or final adoption |
16
+ | preview | `{}`; show complete current mapping before final adoption |
17
+ | status | `{}` |
18
+ | export | `{}`; save, re-capture and complete once, then exit; with `--password-fd` the delivered `asset.kdna` is the protected container |
15
19
 
16
- The Host translates that request into private machine input. It does not ask
17
- the user for a mode enum, workflow enum, Agent ID, operation ID, digest,
18
- schema, signing key, receipt, seed, or application matrix.
20
+ Each alternative has `{localKey,title,subject,scope,statement,rationale,materials:[1]}`. At least two substantive alternatives are required. Optional fields are `method`, `formationRule`, `publicSources`, `publicNotices`; all other fields reject. `materials` is the only CLI adapter, converted to Studio material references. Never send protocol IDs, public profile definitions, native carriers, evidence digests or compiler context.
19
21
 
20
- Ask only when a meaningful fact is missing:
22
+ `method` is `{method:{term},components?,bindings?}`. Its term must be one of the bound Core's published method kinds. A component has `{localKey,type,method:{term},role,content,statement}`; the component's declared basic method equals the judgment term, its role lies in that kind's published role family, and required roles must be covered by non-empty typed content. Content uses the exact current public item/edge/discriminator types. Types are taxonomy, candidate-set and discriminator-set; the latter uses `candidateSetLocalKey` within this judgment. `bindings` remains declared-empty on this path: native bindings are typed edges owned by the graph, not authored links back to the judgment. A missing method rejects (`CREATION_METHOD_REQUIRED`); missing own arrays mean undeclared; explicit `[]` means declared empty; null and owned undefined reject. Core alone determines content interpretation and valid shared grammar.
21
23
 
22
- - Is the judgment the user's or organization's represented judgment, an
23
- interpretation of material, Agent-authored, or genuinely co-authored?
24
- - Which explicit file or directory may be considered?
25
- - Must material stay local-only, may it go to a named remote processor, and
26
- does the user require a separately trusted Host attestation?
27
- - Should the final file be ordinary possession-load, protected, or remote?
24
+ `formationRule:{conditions:[{kind:'interpreted',statement}]}` makes the authored statement a formation rule rather than an invented fixed result. An explicit empty condition set stays empty. Do not AND candidate-specific conditions into a global prerequisite. Public sources/notices are explicitly authored public identity and notice records, documented by Studio; private source paths and interview bodies must not be automatically published.
28
25
 
29
- In Runtime terminology, `access: public` means possession of the file is
30
- sufficient to load it. It does not publish the asset to the Internet. Creation
31
- never shares or publishes automatically.
26
+ During `review`, the CLI emits `adoption_reply` with actual text, the current Studio review and a fresh `replyTo` ticket. Then send one interpretation:
32
27
 
33
- ## Private workspace
34
-
35
- Choose one private workspace under the project root. The CLI excludes it from
36
- material inventory and protects it from accidental Git staging.
37
-
38
- ```bash
39
- kdna-studio guide-agent --action create --json
40
- kdna-studio create-agent .kdna-creation/title-rule \
41
- --input-file /private/path/to/host-generated-create-input.json --json
42
- ```
43
-
44
- The path shown above is illustrative. Private structured input uses stdin or a
45
- mode-0600 file. Never place source text, judgments, passwords, or API keys in
46
- argv or shell history.
47
-
48
- If the workspace already exists:
49
-
50
- ```bash
51
- kdna-studio guide-agent .kdna-creation/title-rule --json
28
+ ```json
29
+ {"id":"choose-current","op":"interpret","data":{"replyTo":"COPY_CURRENT_TICKET","kind":"select","choices":[{"judgmentLocalKey":"observation","alternativeLocalKey":"preserve"}]}}
52
30
  ```
53
31
 
54
- The Host creates and persists technical actor and operation identifiers. The
55
- user does not supply them. Follow `next_action.required_actor` and
56
- `next_action.requires_user`; do not bypass an authority pause in prompt text.
57
- Run `guide-agent` after state changes to obtain the supported public command
58
- and template. Do not read package source or private workspace JSON to discover
59
- machine fields.
60
-
61
- ## Material-first sequence
62
-
63
- Zero material is valid. For one or more explicit paths, no content may be read
64
- before inventory approval.
65
-
66
- 1. Create a content-free preview:
67
-
68
- ```bash
69
- kdna-studio inventory-agent .kdna-creation/title-rule \
70
- --material ./title-notes.md \
71
- --input-file /private/path/to/processing-policy.json --json
72
- ```
73
-
74
- 2. Show the user relative paths, exclusions, unsupported items, duplicates,
75
- batch continuation, the declared local or named-remote destination, and
76
- whether the Host fact is caller-declared or separately attested.
77
- 3. Bind the exact inventory digest through Host-owned private machine input.
78
- When the user's original instruction already covers the displayed path,
79
- processing destination, and boundary, this does not require a second
80
- digest-oriented user question. Ask again only for an unexpected path,
81
- sensitive item, unsupported coverage gap, destination drift, or genuine
82
- ambiguity.
83
- 4. The Host delivers only an accepted entry. A standard named-remote terminal
84
- Host uses a pre-created mode-0600 system-temporary file; this is a Host
85
- machine coordinate, not a user instruction:
86
-
87
- ```bash
88
- private_material_file="$(mktemp)"
89
- chmod 600 "$private_material_file"
90
- trap 'rm -f "$private_material_file"' EXIT INT TERM
91
- kdna-studio deliver-material .kdna-creation/title-rule \
92
- --input-file /private/path/to/delivery-request.json \
93
- --private-output-file "$private_material_file" --json
94
- ```
95
-
96
- The Host reads that temporary file into the explicitly approved named model
97
- context, subject to that provider's declared retention policy, and must delete
98
- the file in `finally`. A dedicated Host adapter may instead provide fd 3; a
99
- regular fd target must be mode 0600 or stricter and must not alias stdout or
100
- stderr. This path keeps content out of CLI JSON/stdout/stderr/workspace,
101
- but it is remote model processing—not “private model input”, log-free proof,
102
- or verified-local evidence. A caller-supplied capability digest is only
103
- `host-declared`; it cannot prove verified local-only processing. When verified
104
- assurance is required, a separately trusted Host adapter is mandatory and the
105
- generic CLI stops before reading.
106
-
107
- Directory previews exclude VCS metadata, dependencies, build/cache output,
108
- the Creation workspace, managed candidates, output paths, and secret-like
109
- files by default. Unsupported or failed items remain visible while usable
110
- items continue. File and byte limits are recoverable batch budgets; they are
111
- not minimums or maximum logical source counts.
112
-
113
- The current candidate does not provide offset continuation inside one text
114
- file above the direct-processing byte limit. That item is explicitly
115
- unsupported; the actionable fallback is an explicitly selected split copy
116
- whose parts preserve ordering and full coverage. The CLI does not falsely
117
- promise that resubmitting the same file advances an internal cursor.
118
-
119
- Text uses strict UTF-8 and no silent prefix truncation. PDF and word-processing
120
- capability is probed before delivery. Images, audio, video, and other
121
- Host-observed sources require an exact source digest plus a bounded
122
- observation that records tool/Host coordinate, coverage, uncertainty, and
123
- observation digest. The observation never represents the source author.
124
-
125
- ## Build the bounded judgment
126
-
127
- A valid asset may contain one complete Judgment Unit and no relation:
128
-
129
- - statement and rationale;
130
- - when it applies;
131
- - when it does not apply or must exit;
132
- - misuse risk;
133
- - traceable source or explicit Agent inference;
134
- - bounded counterexample search and residual uncertainty;
135
- - explicit card type and confidence.
136
-
137
- Do not invent a worldview, value hierarchy, conflict, priority, exception,
138
- correction, or additional judgment to satisfy a sample shape. A current,
139
- digest-bound review may record `reviewed-no-change`.
140
-
141
- Use the structured machine actions returned by `resume`:
142
-
143
- ```bash
144
- kdna-studio answer <workspace> --input-file <private-answer.json> --json
145
- kdna-studio review <workspace> --input-file <private-review.json> --json
146
- kdna-studio try <workspace> --input-file <private-test.json> --json
147
- kdna-studio repair <workspace> --input-file <private-repair.json> --json
148
- ```
149
-
150
- Human and organization representation requires the corresponding current
151
- authority. Autonomous Agent-authored and interpretive work can continue with a
152
- distinct independent evaluator Agent. The creating Agent cannot accept its
153
- own held-out evaluation. Low confidence can be resolved through more evidence,
154
- an honest narrower scope, or an explicit bounded uncertainty; it must not
155
- deadlock merely because the workflow is autonomous.
156
-
157
- ## Three gates
158
-
159
- Keep the status fields separate:
160
-
161
- - `JUDGMENT_ACCEPTED` — current, source- and authority-honest judgments have
162
- applicable semantic and boundary evidence.
163
- - `FORMAT_VALID` — the exact managed candidate is a valid, compatible Runtime
164
- asset container.
165
- - `APPLICATION_VERIFIED` — an official Host loads those exact bytes in a fresh
166
- Consumer context and obtains independent applicable-dimension evaluation and
167
- pre-frozen stability evidence.
168
-
169
- A loadable container without a current password may still be format-valid;
170
- authorization and actual load belong to the third gate. Likewise, semantic
171
- tests alone cannot establish Application Verified without actual Runtime
172
- loading and Consumer use.
173
-
174
- Coverage is based on the asset's structure and risk. It always proves
175
- application plus boundary or exit and prevents over-application. Priority,
176
- exception, conflict, authority-precedence, and high-risk cases are required
177
- only when declared or applicable. At least one core or highest-risk scenario
178
- has repeated stability evidence; every task does not need a fixed multi-seed
179
- matrix.
180
-
181
- ## Managed candidate, verification, and delivery
182
-
183
- Create the exact private test candidate:
184
-
185
- ```bash
186
- kdna-studio export-agent <workspace> --json
187
- ```
188
-
189
- `export-agent` does not accept `--out` and does not create a user delivery.
190
- The official Host then orchestrates the required isolated Consumer and
191
- independent evaluator against those exact managed bytes. The ordinary user
192
- does not construct role keys, signatures, plans, or receipts. If the current
193
- Host lacks that official adapter, report the Host-integration blocker instead
194
- of using the creating Agent or a private benchmark as a substitute.
195
-
196
- Only after all three gates bind the same semantic and asset digests:
197
-
198
- ```bash
199
- kdna-studio finalize-agent <workspace> --out ./title-rule.kdna --json
200
- ```
201
-
202
- Finalization atomically copies the already verified bytes. It does not
203
- recompile, write inside the workspace, or ask for a redundant password just to
204
- copy verified ciphertext. Stale receipts, replaced candidates, path aliases,
205
- and partial transactions fail without leaving a target file.
206
-
207
- ## Recovery and lifecycle
32
+ Select chooses exactly one current alternative for every group. Other supported kinds are `note`, `reject`, `confirm`, without `choices`. To revise, record the actual feedback, send a current `revise` operation, select again, request a fresh preview, then obtain a fresh final reply. A final confirmation binds the exact current preview, alternatives, context and adoption channel. The Agent interprets real language; it cannot fabricate a reviewer reply, role, message/review id or final digest through its pipe.
208
33
 
209
- After a crash or Agent handoff, call `resume`. The workspace either reopens an
210
- authorized source capability and verifies the exact bytes or requests source
211
- reauthorization. Chat context is not recovery evidence.
34
+ The pending review receives its final result after interpretation. There is no separate interpretation success reply. Reusing ids/tickets, changing role/channel, replacing the current review, EOF or input errors reject. Agent termination while waiting abandons the unexported session. Keep one request active; excess queued frames reject. No automatic decision or persistent replay/resume exists.
212
35
 
213
- The current local Creation lifecycle is create, resume, revise, invalidate
214
- stale confirmations/tests, retest, finalize, and recover the last valid state.
215
- Stopping retains the private workspace. The CLI does not yet expose a general
216
- workspace-abandon/delete command; application-attempt abandonment closes only
217
- one interrupted Consumer attempt. Sharing, publication, deprecation,
218
- revocation, marketplace distribution, and Studio App management are separate
219
- capabilities.
36
+ Export creates one exclusive private bundle and obtains `accepted_with_live_context` only after actual saved-byte readback. Static `verify` always retains `live_context:unavailable` and `creation_accepted:not_evaluated`; it cannot resurrect the capability. Core/Read and static evidence consistency remain separate from actual Agent adoption, verified identity, action permission, Authoring Fit/G4B and publication readiness. Legacy format1 and old completion markers require their original accepted graph and cannot be relabeled current.
package/package.json CHANGED
@@ -1,47 +1,43 @@
1
1
  {
2
2
  "name": "@aikdna/kdna-studio-cli",
3
- "version": "0.11.0",
4
- "description": "Official KDNA Studio command-line authoring entry for creating, reviewing, compiling, and exporting .kdna judgment assets through the KDNA toolchain.",
3
+ "version": "0.13.0-rc.components.2",
4
+ "description": "Terminal Host for current typed Studio creation and separate human or authorized Agent adoption channels.",
5
5
  "type": "commonjs",
6
6
  "bin": {
7
7
  "kdna-studio": "bin/kdna-studio.js"
8
8
  },
9
9
  "files": [
10
10
  "bin/kdna-studio.js",
11
- "src/ai/index.js",
12
- "src/ai/distill.js",
13
- "src/ai/filter.js",
14
- "src/ai/interview.js",
15
- "src/creation-cli.js",
16
- "src/application-host.js",
17
- "src/llm/",
11
+ "src/terminal-workspace.js",
12
+ "src/public-bindings.json",
18
13
  "docs/CREATION_COMMAND_CONTRACT.md",
19
14
  "docs/TERMINAL_AGENT_CREATION.md",
20
15
  "LICENSE",
21
16
  "NOTICE",
22
- "README.md"
17
+ "README.md",
18
+ "src/component-operations.js"
23
19
  ],
24
20
  "scripts": {
25
- "lint": "node scripts/run-lint.js",
26
- "pretest": "node scripts/acquire-trusted-npm-release.js",
27
- "test": "node --test tests/*.test.js",
21
+ "lint": "node --check bin/kdna-studio.js && node --check src/terminal-workspace.js && node --check src/component-operations.js",
22
+ "test": "node --test tests/current-components/*.test.cjs tests/current/*.test.js",
28
23
  "test:all": "node scripts/run-test-all.js",
29
- "test:runtime": "node scripts/run-product-tests.js",
30
- "test:candidate-chain": "node scripts/verify-runtime-candidate-chain.js",
31
- "verify:candidate-sources": "node scripts/verify-runtime-candidate-sources.js",
24
+ "test:candidate-chain": "node scripts/verify-current-candidate-chain.js",
25
+ "verify:candidate-sources": "node scripts/verify-current-candidate-sources.js",
32
26
  "check:protocol-names": "node scripts/check-current-protocol-names.js",
27
+ "check:publish-coordinates": "node scripts/check-publish-coordinates.js",
33
28
  "release:check": "node scripts/release-check.js",
34
29
  "release:generate-evidence": "node scripts/generate-release-evidence.js",
35
30
  "release:publish-verified": "node scripts/publish-verified-artifact.js",
36
- "prepublishOnly": "node scripts/run-test-all.js && node scripts/verify-runtime-candidate-chain.js && node scripts/release-check.js"
31
+ "candidate:publish-verified": "node scripts/publish-candidate-artifact.js",
32
+ "prepublishOnly": "node scripts/check-publish-coordinates.js && node scripts/run-test-all.js && node scripts/verify-current-candidate-chain.js && node scripts/release-check.js",
33
+ "check:current-bindings": "node scripts/generate-current-bindings.js",
34
+ "candidate:generate-evidence": "node scripts/generate-candidate-evidence.js"
37
35
  },
38
36
  "keywords": [
39
37
  "kdna",
40
- "kdna-studio",
41
- "kdna-studio-cli",
42
- "authoring",
43
- "provenance",
44
- "judgment-cards"
38
+ "agent-native",
39
+ "creation",
40
+ "terminal"
45
41
  ],
46
42
  "license": "Apache-2.0",
47
43
  "repository": {
@@ -53,17 +49,24 @@
53
49
  "url": "https://github.com/aikdna/kdna-studio-cli/issues"
54
50
  },
55
51
  "engines": {
56
- "node": ">=18"
52
+ "node": ">=22"
57
53
  },
58
54
  "dependencies": {
59
- "@aikdna/kdna-core": "0.21.0",
60
- "@aikdna/kdna-studio-core": "3.0.0",
61
- "ajv": "^8.20.0",
62
- "ajv-formats": "^3.0.1",
63
- "cbor-x": "^1.6.4"
55
+ "@aikdna/kdna-core": "0.37.1-rc.browser.1",
56
+ "@aikdna/kdna-read": "0.11.2-rc.browser.1",
57
+ "@aikdna/kdna-studio-core": "4.0.0-rc.components.2"
64
58
  },
65
59
  "directories": {
66
60
  "test": "tests"
67
61
  },
68
- "author": ""
62
+ "author": "",
63
+ "overrides": {
64
+ "fast-uri": "3.1.8",
65
+ "@aikdna/kdna-core": "$@aikdna/kdna-core",
66
+ "@aikdna/kdna-read": "$@aikdna/kdna-read",
67
+ "@aikdna/kdna-studio-core": "$@aikdna/kdna-studio-core"
68
+ },
69
+ "exports": {
70
+ "./package.json": "./package.json"
71
+ }
69
72
  }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // CLI-only material ordinal adapter. Shared component meaning remains upstream.
3
+ function componentOperations(workspace,materialIds){
4
+ const fail=code=>{throw Object.assign(new Error(code),{code});};
5
+ function record(v,keys){if(!v||typeof v!=='object'||Array.isArray(v)||Object.keys(v).some(k=>!keys.includes(k))||keys.some(k=>!Object.hasOwn(v,k)))fail('CLI_COMPONENT_INPUT_INVALID');}
6
+ function authored(a){if(!a||!Array.isArray(a.materials)||Object.hasOwn(a,'materialRefs'))fail('CLI_COMPONENT_MATERIAL_INVALID');const ids=typeof materialIds==='function'?materialIds():materialIds;const x={...a,materialRefs:a.materials.map(n=>{if(!Number.isSafeInteger(n)||n<1||n>ids.length)fail('CLI_MATERIAL_UNKNOWN');return ids[n-1];})};delete x.materials;return x;}
7
+ return Object.freeze({
8
+ propose(data){record(data,['localKey','alternatives']);if(!Array.isArray(data.alternatives))fail('CLI_COMPONENT_INPUT_INVALID');return workspace.agent.propose({localKey:data.localKey,alternatives:data.alternatives.map(authored)});},
9
+ revise(data){record(data,['localKey','baseRevision','alternatives','explanation']);if(!Array.isArray(data.alternatives))fail('CLI_COMPONENT_INPUT_INVALID');return workspace.agent.revise(data.localKey,{baseRevision:data.baseRevision,alternatives:data.alternatives.map(authored),explanation:data.explanation});},
10
+ preview(){return workspace.agent.compilePreview();},review(){return workspace.receiveAdoptionReply();},completeSavedReadback(bytes){return workspace.completeSave(bytes);},abort(){return workspace.abort();}
11
+ });
12
+ }
13
+ module.exports={componentOperations};