Skip to content

Commit 7d2f00f

Browse files
committed
feat: cognitive hints and safety block in capability contracts
Cognitive hints (3-layer resolution): - vocabulary/cognitive_types.yaml: 15 semantic types, 7 roles - 11 capabilities annotated with cognitive_hints (role, produces, consumes) - validate_registry.py: cognitive_hints validation against vocabulary - generate_catalog.py: cognitive_hints propagated to catalog - CAPABILITIES.md: full cognitive_hints schema reference Safety block (v2 enforcement): - vocabulary/safety_vocabulary.yaml: trust_levels, data_classifications, failure_policies, allowed_targets, scope_constraints - 5 side-effecting capabilities annotated with safety block - validate_registry.py: safety validation + v2 enforcement (required for side_effects: true) - generate_catalog.py: safety propagated to catalog - CAPABILITIES.md: full safety schema reference Documentation: - LANGUAGE.md: safety block section in capability language spec - VOCABULARY.md: safety vocabulary cross-reference section - catalog regenerated with all artifacts
1 parent 44b1c64 commit 7d2f00f

23 files changed

+1233
-6
lines changed

capabilities/agent.plan.create.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ outputs:
4242
List of validation error strings found in the generated output.
4343
Empty list means the YAML is valid.
4444
45+
cognitive_hints:
46+
role: synthesize
47+
consumes:
48+
- Context
49+
produces:
50+
skill_yaml:
51+
type: Plan
52+
capabilities_used:
53+
type: Context
54+
4555
metadata:
4656
status: experimental
4757
tags:

capabilities/agent.task.delegate.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ outputs:
1515
type: boolean
1616
required: true
1717
description: Whether delegation was accepted.
18+
19+
safety:
20+
trust_level: elevated
21+
reversible: false
22+
requires_confirmation: true
23+
allowed_targets:
24+
- approved_connectors
25+
1826
properties:
1927
deterministic: false
2028
side_effects: true

capabilities/analysis.risk.extract.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,23 @@ outputs:
6464
description: >
6565
Brief note on methodology, gaps in available information, or caveats.
6666
67+
cognitive_hints:
68+
role: analyze
69+
consumes:
70+
- Artifact
71+
- Context
72+
produces:
73+
risks:
74+
type: Risk
75+
assumptions:
76+
type: Evidence
77+
failure_modes:
78+
type: Risk
79+
mitigation_ideas:
80+
type: Context
81+
extraction_notes:
82+
type: Summary
83+
6784
properties:
6885
deterministic: false
6986
side_effects: false

capabilities/analysis.theme.cluster.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ outputs:
5151
coverage_ratio (fraction of items assigned), overlap_warnings
5252
(list of items assigned to multiple clusters).
5353
54+
cognitive_hints:
55+
role: analyze
56+
consumes:
57+
- Entity
58+
- Context
59+
produces:
60+
clusters:
61+
type: Entity
62+
cluster_quality:
63+
type: Score
64+
5465
properties:
5566
deterministic: false
5667
side_effects: false

capabilities/code.snippet.execute.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ outputs:
2323
type: string
2424
required: false
2525
description: Standard error.
26+
27+
safety:
28+
trust_level: privileged
29+
data_classification: internal
30+
reversible: false
31+
requires_confirmation: true
32+
scope_constraints:
33+
- sandboxed_execution
34+
2635
properties:
2736
deterministic: false
2837
side_effects: true

capabilities/data.record.deduplicate.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ outputs:
1919
type: integer
2020
required: false
2121
description: Number of removed duplicates.
22+
23+
cognitive_hints:
24+
role: act
25+
consumes:
26+
- Entity
27+
produces:
28+
records:
29+
type: Entity
30+
2231
properties:
2332
deterministic: true
2433
side_effects: false

capabilities/decision.option.justify.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,30 @@ outputs:
106106
consumption. Includes what was decided, why, key trade-offs, risks,
107107
and next steps.
108108
109+
cognitive_hints:
110+
role: decide
111+
consumes:
112+
- Score
113+
- Option
114+
- Tradeoff
115+
produces:
116+
recommendation:
117+
type: Decision
118+
alternatives_considered:
119+
type: Option
120+
confidence_score:
121+
type: Score
122+
confidence_level:
123+
type: Score
124+
uncertainties:
125+
type: Uncertainty
126+
failure_modes:
127+
type: Risk
128+
next_steps:
129+
type: Plan
130+
human_readable:
131+
type: Summary
132+
109133
properties:
110134
deterministic: false
111135
side_effects: false

capabilities/email.message.send.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ outputs:
1919
type: boolean
2020
required: true
2121
description: Whether sending succeeded.
22+
23+
cognitive_hints:
24+
role: act
25+
consumes:
26+
- Message
27+
produces:
28+
sent:
29+
type: Artifact
30+
31+
safety:
32+
trust_level: elevated
33+
data_classification: pii
34+
reversible: false
35+
requires_confirmation: true
36+
allowed_targets:
37+
- internal_only
38+
mandatory_pre_gates:
39+
- capability: security.pii.detect
40+
on_fail: block
41+
2242
properties:
2343
deterministic: true
2444
side_effects: true

capabilities/eval.option.score.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ outputs:
6666
Explicit trade-offs between top candidates. Each entry names the tension
6767
and what is gained/lost.
6868
69+
cognitive_hints:
70+
role: evaluate
71+
consumes:
72+
- Option
73+
- Criterion
74+
produces:
75+
scored_options:
76+
type: Score
77+
criteria_used:
78+
type: Criterion
79+
comparative_summary:
80+
type: Summary
81+
tradeoffs:
82+
type: Tradeoff
83+
6984
properties:
7085
deterministic: false
7186
side_effects: false

capabilities/fs.file.read.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,12 @@ outputs:
1919

2020
bytes:
2121
type: object
22-
description: Raw bytes (if mode is binary).
22+
description: Raw bytes (if mode is binary).
23+
24+
cognitive_hints:
25+
role: perceive
26+
produces:
27+
content:
28+
type: Artifact
29+
bytes:
30+
type: Artifact

0 commit comments

Comments
 (0)