Skip to content

Commit 44b1c64

Browse files
committed
docs: extend language and skill format for CognitiveState v1 namespaces
1 parent b1e323f commit 44b1c64

File tree

2 files changed

+101
-6
lines changed

2 files changed

+101
-6
lines changed

docs/LANGUAGE.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,35 @@ Each step defines:
116116

117117
The registry language supports references between values.
118118

119-
Supported reference types:
119+
Supported reference types (legacy):
120120

121121
inputs.<field>
122122
vars.<field>
123123
outputs.<field>
124124

125+
CognitiveState v1 reference types (runtime extension):
126+
127+
frame.<path>
128+
working.<path>
129+
output.<path>
130+
extensions.<path>
131+
132+
CognitiveState v1 namespaces are supported by the `agent-skills` runtime.
133+
They provide structured cognitive processing for multi-step reasoning skills.
134+
Legacy references remain the default and work in all runtimes.
135+
136+
Path traversal supports nested access (dict keys, list indices):
137+
138+
frame.constraints.budget
139+
working.entities.0.name
140+
125141
Examples:
126142

127143
inputs.url
128144
vars.text
129145
outputs.summary
146+
frame.goal
147+
working.artifacts.draft
130148

131149
------------------------------------------------------------------------
132150

@@ -142,6 +160,13 @@ Data may flow through:
142160
- `vars`
143161
- `outputs`
144162

163+
CognitiveState v1 adds four additional namespaces (runtime extension):
164+
165+
- `frame` (read-only reasoning context)
166+
- `working` (mutable cognitive working memory)
167+
- `output` (structured result metadata)
168+
- `extensions` (open namespace for plugins)
169+
145170
### Inputs
146171

147172
Provided by the caller.
@@ -213,6 +238,11 @@ Simplified reference grammar:
213238

214239
reference := inputs.field | vars.field | outputs.field
215240

241+
CognitiveState v1 extended grammar (runtime extension):
242+
243+
reference := inputs.field | vars.field | outputs.field
244+
| frame.path | working.path | output.path | extensions.path
245+
216246
Capability identifier grammar:
217247

218248
domain.noun.verb

docs/SKILL_FORMAT.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,31 +530,70 @@ vars.*
530530
outputs.*
531531
```
532532

533+
CognitiveState v1 also supports (agent-skills runtime extension):
534+
535+
```
536+
working.*
537+
output.*
538+
extensions.*
539+
```
540+
533541
Example:
534542

535543
```yaml
536544
output:
537545
summary: outputs.summary
538546
```
539547

548+
CognitiveState v1 example:
549+
550+
```yaml
551+
output:
552+
entities: working.entities
553+
draft: working.artifacts.first_draft
554+
quality: output.result_type
555+
```
556+
540557
---
541558

542559
# Valid References
543560

544-
Skills support only the following reference forms:
561+
Skills support the following reference forms:
562+
563+
Legacy (all runtimes):
545564

546565
```
547566
inputs.*
548567
vars.*
549568
outputs.*
550569
```
551570

571+
CognitiveState v1 (agent-skills runtime extension):
572+
573+
```
574+
frame.*
575+
working.*
576+
output.*
577+
extensions.*
578+
```
579+
580+
CognitiveState v1 references support nested path traversal (dict keys, list indices):
581+
582+
```
583+
frame.constraints.budget
584+
working.entities.0.name
585+
working.artifacts.draft
586+
```
587+
552588
Examples:
553589

554590
```
555591
inputs.file_path
556592
vars.document_text
557593
outputs.summary
594+
frame.goal
595+
working.risks
596+
output.result_type
558597
```
559598

560599
---
@@ -564,10 +603,36 @@ outputs.summary
564603
The following rules apply:
565604

566605
1. Steps cannot modify `inputs`.
567-
2. Steps may write only to `vars` or `outputs`.
568-
3. Each target field should be written once.
569-
4. Outputs declared in the skill must be produced by a step.
570-
5. Steps may consume values produced by earlier steps.
606+
2. Steps may write to `vars` or `outputs` (legacy), or `working`, `output`, `extensions` (CognitiveState v1).
607+
3. Steps cannot write to `frame` (frozen) or `trace` (engine-managed).
608+
4. Each target field should be written once (unless a merge strategy is declared).
609+
5. Outputs declared in the skill must be produced by a step.
610+
6. Steps may consume values produced by earlier steps.
611+
612+
### Merge Strategies (CognitiveState v1)
613+
614+
When multiple steps write to the same target, a merge strategy may be declared
615+
in `step.config.merge_strategy`:
616+
617+
| Strategy | Behavior |
618+
|----------|----------|
619+
| `overwrite` | Default. Error on duplicate target. |
620+
| `append` | Extends list targets via concatenation. |
621+
| `deep_merge` | Recursively merges dict targets. |
622+
| `replace` | Unconditionally overwrites, no error. |
623+
624+
Example:
625+
626+
```yaml
627+
- id: collect_risks
628+
uses: analysis.risk.extract
629+
config:
630+
merge_strategy: append
631+
input:
632+
text: vars.document_text
633+
output:
634+
risks: working.risks
635+
```
571636

572637
Execution order is determined by **data dependencies**.
573638

0 commit comments

Comments
 (0)