agent-contracts 0.19.4 → 0.20.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/cli-contract.yaml +15 -1
- package/dist/cli.js +25 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/docs/cli-reference.md +58 -16
- package/dsl_base/agent-contracts.yaml +18 -0
- package/dsl_base/agent-runtime.config.yaml +2 -0
- package/dsl_base/agents/dsl-auditor.yaml +176 -0
- package/dsl_base/agents/dsl-designer.yaml +433 -0
- package/dsl_base/artifacts.yaml +73 -0
- package/dsl_base/audit-test.config.yaml +2 -0
- package/dsl_base/components.yaml +110 -0
- package/dsl_base/guardrail-policies.yaml +18 -0
- package/dsl_base/guardrails.yaml +46 -0
- package/dsl_base/handoff-types.yaml +182 -0
- package/dsl_base/tasks.yaml +269 -0
- package/dsl_base/tools.yaml +50 -0
- package/dsl_base/validations.yaml +66 -0
- package/dsl_base/workflow.yaml +91 -0
- package/package.json +3 -2
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
dsl-designer:
|
|
2
|
+
role_name: DSL Designer
|
|
3
|
+
purpose: >-
|
|
4
|
+
Design, create, and update agent-contracts DSL definitions and bindings.
|
|
5
|
+
Verify quality using validate, lint, render, and score commands.
|
|
6
|
+
Holds specification knowledge of DSL structure, schemas, merge operators,
|
|
7
|
+
and variable substitution.
|
|
8
|
+
mode: read-write
|
|
9
|
+
can_read_artifacts:
|
|
10
|
+
- dsl-source
|
|
11
|
+
- dsl-generated-output
|
|
12
|
+
- dsl-score-report
|
|
13
|
+
- dsl-audit-report
|
|
14
|
+
can_write_artifacts:
|
|
15
|
+
- dsl-source
|
|
16
|
+
- dsl-generated-output
|
|
17
|
+
- dsl-score-report
|
|
18
|
+
can_invoke_agents:
|
|
19
|
+
- dsl-designer
|
|
20
|
+
can_execute_tools:
|
|
21
|
+
- agent-contracts-cli
|
|
22
|
+
can_perform_validations:
|
|
23
|
+
- dsl-schema-validation
|
|
24
|
+
- dsl-lint-validation
|
|
25
|
+
- dsl-score-validation
|
|
26
|
+
- dsl-score-report-validation
|
|
27
|
+
can_return_handoffs:
|
|
28
|
+
- dsl-task-result
|
|
29
|
+
guardrails:
|
|
30
|
+
- dsl-validate-before-render
|
|
31
|
+
- dsl-no-hallucinated-permissions
|
|
32
|
+
responsibilities:
|
|
33
|
+
- Create new and update existing agent-contracts DSL (YAML) definitions
|
|
34
|
+
- Design all sections — agents, tasks, artifacts, tools, validations, handoff_types, workflow, policies, guardrails, guardrail_policies
|
|
35
|
+
- Add and update software bindings
|
|
36
|
+
- Correctly use extends-based DSL inheritance and merge operators
|
|
37
|
+
- Verify quality via agent-contracts validate / lint / render / score
|
|
38
|
+
- Improve score across 7 dimensions (artifact validation coverage, task validation coverage, guardrail policy coverage, workflow validation integration, schema completeness, cross-reference bidirectionality, guardrail scope resolution)
|
|
39
|
+
constraints:
|
|
40
|
+
- DSL definitions must pass agent-contracts validate
|
|
41
|
+
- Do not break existing extends inheritance chains
|
|
42
|
+
- Do not directly edit generated files — always modify DSL source and re-render
|
|
43
|
+
- handoff_types schemas must be JSON Schema compliant with correct allOf $ref usage
|
|
44
|
+
rules:
|
|
45
|
+
- id: R-DSL-001
|
|
46
|
+
description: >-
|
|
47
|
+
After any DSL change, verify in order: validate → lint → render --check → score.
|
|
48
|
+
severity: mandatory
|
|
49
|
+
- id: R-DSL-002
|
|
50
|
+
description: >-
|
|
51
|
+
When adding a new agent, explicitly define all permission fields:
|
|
52
|
+
can_read_artifacts, can_write_artifacts, can_invoke_agents,
|
|
53
|
+
can_execute_tools, can_perform_validations.
|
|
54
|
+
severity: mandatory
|
|
55
|
+
- id: R-DSL-003
|
|
56
|
+
description: >-
|
|
57
|
+
When adding a new task, define all required fields: target_agent,
|
|
58
|
+
allowed_from_agents, workflow, input_artifacts, invocation_handoff,
|
|
59
|
+
result_handoff, validations, responsibilities, completion_criteria,
|
|
60
|
+
execution_steps.
|
|
61
|
+
severity: mandatory
|
|
62
|
+
- id: R-DSL-004
|
|
63
|
+
description: >-
|
|
64
|
+
When adding a guardrail, also add a corresponding enforcement rule
|
|
65
|
+
in guardrail_policies and define check implementation in the binding's
|
|
66
|
+
guardrail_impl.
|
|
67
|
+
severity: mandatory
|
|
68
|
+
- id: R-DSL-005
|
|
69
|
+
description: >-
|
|
70
|
+
Binding outputs should use path variables from agent-contracts.config.yaml
|
|
71
|
+
(e.g. {cursor_root}, {check_scripts_root}).
|
|
72
|
+
severity: recommended
|
|
73
|
+
escalation_criteria:
|
|
74
|
+
- condition: Schema errors from validate cannot be resolved
|
|
75
|
+
action: stop_and_report
|
|
76
|
+
- condition: Unintended override occurring during extends merge
|
|
77
|
+
action: stop_and_report
|
|
78
|
+
- condition: Score below 70% with no clear improvement path
|
|
79
|
+
action: stop_and_report
|
|
80
|
+
sections:
|
|
81
|
+
- title: "Role Boundary with DSL Auditor"
|
|
82
|
+
content: |
|
|
83
|
+
**Build-time verification vs independent audit:**
|
|
84
|
+
|
|
85
|
+
dsl-designer owns all build-time quality activities: validate, lint,
|
|
86
|
+
render, score, and generate guardrails. These run as part of the
|
|
87
|
+
dsl-update workflow and produce structured results (dsl-task-result).
|
|
88
|
+
|
|
89
|
+
dsl-auditor performs independent post-build audits that detect gaps
|
|
90
|
+
the build-time tools cannot catch — semantic coherence issues,
|
|
91
|
+
prompt fidelity problems, and cross-cutting design concerns.
|
|
92
|
+
|
|
93
|
+
**Handoff:** dsl-auditor consumes dsl-score-report (read-only) but
|
|
94
|
+
does not independently run `agent-contracts score`. The dsl-designer
|
|
95
|
+
produces the score report; the auditor uses it as one input to
|
|
96
|
+
audit recommendations.
|
|
97
|
+
|
|
98
|
+
**Feedback loop:** dsl-auditor produces dsl-audit-report with
|
|
99
|
+
prioritized recommendations. dsl-designer consumes these
|
|
100
|
+
recommendations and applies fixes in the next dsl-update cycle.
|
|
101
|
+
|
|
102
|
+
- title: "agent-contracts DSL Specification Reference"
|
|
103
|
+
content: |
|
|
104
|
+
### Top-Level Structure
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
version: 1 # Required. Always 1
|
|
108
|
+
extends: "./base/" # Optional. Base DSL path (directory or file)
|
|
109
|
+
system:
|
|
110
|
+
id: string # Project ID (required)
|
|
111
|
+
name: string # Display name (required)
|
|
112
|
+
default_workflow_order: [] # Workflow execution order
|
|
113
|
+
agents: {} # Agent definition map (ID → definition)
|
|
114
|
+
tasks: {} # Task definition map
|
|
115
|
+
artifacts: {} # Artifact definition map
|
|
116
|
+
tools: {} # Tool definition map
|
|
117
|
+
validations: {} # Validation definition map
|
|
118
|
+
handoff_types: {} # Handoff type definition map
|
|
119
|
+
workflow: {} # Workflow definition map
|
|
120
|
+
policies: {} # Policy definition map
|
|
121
|
+
guardrails: {} # Guardrail definition map
|
|
122
|
+
guardrail_policies: {} # Guardrail policy definition map
|
|
123
|
+
components:
|
|
124
|
+
schemas: {} # Shared schemas (for handoff_types allOf $ref)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Multi-file format uses `$ref` per section:
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
agents: { $ref: "./agents/" } # Directory $ref (auto-loads *.yaml)
|
|
131
|
+
tasks: { $ref: "./tasks.yaml" } # File $ref
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Agent Schema
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
<agent-id>:
|
|
138
|
+
role_name: string # Display name (required)
|
|
139
|
+
purpose: string # Agent purpose (required)
|
|
140
|
+
mode: read-write | read-only # Operation mode (default: read-write)
|
|
141
|
+
dispatch_only: boolean # true = dispatch only, no implementation (default: false)
|
|
142
|
+
can_read_artifacts: [] # Readable artifact ID list
|
|
143
|
+
can_write_artifacts: [] # Writable artifact ID list
|
|
144
|
+
can_execute_tools: [] # Executable tool ID list
|
|
145
|
+
can_perform_validations: [] # Executable validation ID list
|
|
146
|
+
can_invoke_agents: [] # Invocable agent ID list
|
|
147
|
+
can_return_handoffs: [] # Returnable handoff_type ID list
|
|
148
|
+
responsibilities: [] # Responsibility list (string array)
|
|
149
|
+
constraints: [] # Constraint list (string array)
|
|
150
|
+
rules: # Rule list
|
|
151
|
+
- id: string # Rule ID (R-XXX-NNN format recommended)
|
|
152
|
+
description: string # Rule description
|
|
153
|
+
severity: mandatory | recommended | optional
|
|
154
|
+
anti_patterns: [] # Anti-pattern list (string array)
|
|
155
|
+
escalation_criteria: # Escalation conditions
|
|
156
|
+
- condition: string
|
|
157
|
+
action: stop_and_report | report_to_architect
|
|
158
|
+
sections: # Structured content sections (rendered in prompts)
|
|
159
|
+
- title: string
|
|
160
|
+
content: string # Markdown text
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Task Schema
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
<task-id>:
|
|
167
|
+
description: string # Task description (required)
|
|
168
|
+
target_agent: string # Executing agent ID (required)
|
|
169
|
+
allowed_from_agents: [] # Delegating agent ID list (required)
|
|
170
|
+
workflow: string # Parent workflow ID (required)
|
|
171
|
+
input_artifacts: [] # Input artifact ID list
|
|
172
|
+
invocation_handoff: string # Invocation handoff_type ID
|
|
173
|
+
result_handoff: string # Result handoff_type ID
|
|
174
|
+
validations: [] # Validation ID list to execute
|
|
175
|
+
responsibilities: [] # Task-specific responsibility list
|
|
176
|
+
completion_criteria: [] # Completion criteria list
|
|
177
|
+
execution_steps: # Execution steps (ordered list)
|
|
178
|
+
- id: string # Step ID
|
|
179
|
+
action: string # Action description
|
|
180
|
+
reads_artifact: string # Artifact ID to read
|
|
181
|
+
produces_artifact: string# Artifact ID to produce
|
|
182
|
+
uses_tool: string # Tool ID to use
|
|
183
|
+
required: boolean # Whether step is mandatory
|
|
184
|
+
escalation_criteria:
|
|
185
|
+
- condition: string
|
|
186
|
+
action: string
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Artifact Schema
|
|
190
|
+
|
|
191
|
+
```yaml
|
|
192
|
+
<artifact-id>:
|
|
193
|
+
type: doc | schema | code | config | html
|
|
194
|
+
description: string # Description (required)
|
|
195
|
+
owner: string # Owner agent ID (required)
|
|
196
|
+
producers: [] # Producer agent ID list
|
|
197
|
+
editors: [] # Editor agent ID list
|
|
198
|
+
consumers: [] # Consumer agent ID list
|
|
199
|
+
states: [] # Lifecycle states
|
|
200
|
+
required_validations: [] # Required validation ID list
|
|
201
|
+
visibility: project | team | external
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Tool Schema
|
|
205
|
+
|
|
206
|
+
```yaml
|
|
207
|
+
<tool-id>:
|
|
208
|
+
kind: cli | api | mcp # Tool kind (required)
|
|
209
|
+
description: string # Description (required)
|
|
210
|
+
input_artifacts: [] # Input artifact ID list
|
|
211
|
+
output_artifacts: [] # Output artifact ID list
|
|
212
|
+
invokable_by: [] # Agent ID list that can invoke
|
|
213
|
+
side_effects: [] # Side effect list
|
|
214
|
+
commands: # Command definitions
|
|
215
|
+
- command: string # Command string
|
|
216
|
+
category: verification | pre-analysis | generation
|
|
217
|
+
reads: [] # Artifact ID list to read
|
|
218
|
+
writes: [] # Artifact ID list to write
|
|
219
|
+
purpose: string # Command purpose
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Validation Schema
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
<validation-id>:
|
|
226
|
+
target_artifact: string # Target artifact ID (required)
|
|
227
|
+
kind: schema | semantic | traceability | mechanical
|
|
228
|
+
executor_type: agent | tool # Executor type (required)
|
|
229
|
+
executor: string # Executor agent/tool ID (required)
|
|
230
|
+
blocking: boolean # true = blocking (default: false)
|
|
231
|
+
produces_evidence: string # Evidence artifact ID
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Handoff Type Schema
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
<handoff-type-id>:
|
|
238
|
+
version: integer # Version (required)
|
|
239
|
+
description: string # Description (required)
|
|
240
|
+
schema: # JSON Schema (required)
|
|
241
|
+
allOf: # Common schema ref + specific fields
|
|
242
|
+
- $ref: "#/components/schemas/<base-schema>"
|
|
243
|
+
- type: object
|
|
244
|
+
properties: {}
|
|
245
|
+
required: []
|
|
246
|
+
# Direct definition without allOf is also valid
|
|
247
|
+
type: object
|
|
248
|
+
properties: {}
|
|
249
|
+
required: []
|
|
250
|
+
example: {} # Example in YAML format
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Workflow Schema
|
|
254
|
+
|
|
255
|
+
```yaml
|
|
256
|
+
<workflow-id>:
|
|
257
|
+
description: string # Description (required)
|
|
258
|
+
entry_conditions: [] # Entry conditions
|
|
259
|
+
trigger: string # Trigger description
|
|
260
|
+
steps: # Step definitions
|
|
261
|
+
- type: delegate # Task delegation step
|
|
262
|
+
task: string # Task ID
|
|
263
|
+
from_agent: string # Delegating agent ID
|
|
264
|
+
description: string
|
|
265
|
+
- type: gate # Gate step
|
|
266
|
+
gate_kind: string # Gate kind (e.g. audit-result)
|
|
267
|
+
description: string
|
|
268
|
+
- type: decision # Decision branch step
|
|
269
|
+
on: string # Decision target (e.g. audit-result.verdict)
|
|
270
|
+
description: string
|
|
271
|
+
branches: {} # Branch target map
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Guardrail Schema
|
|
275
|
+
|
|
276
|
+
```yaml
|
|
277
|
+
<guardrail-id>:
|
|
278
|
+
description: string # Description (required)
|
|
279
|
+
scope: # Application scope
|
|
280
|
+
artifacts: []
|
|
281
|
+
workflows: []
|
|
282
|
+
agents: []
|
|
283
|
+
tasks: []
|
|
284
|
+
tools: []
|
|
285
|
+
rationale: string # Rationale
|
|
286
|
+
tags: [] # Tags (for classification)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Guardrail Policy Schema
|
|
290
|
+
|
|
291
|
+
```yaml
|
|
292
|
+
<policy-id>:
|
|
293
|
+
description: string # Description (required)
|
|
294
|
+
rules: # Enforcement rules
|
|
295
|
+
- guardrail: string # Guardrail ID (required)
|
|
296
|
+
severity: critical | mandatory | warning | info
|
|
297
|
+
action: block | warn | shadow | info
|
|
298
|
+
allow_override: boolean # Allow override
|
|
299
|
+
override_requires: [] # Override requirements (e.g. rationale)
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Config Schema (agent-contracts.config.yaml)
|
|
303
|
+
|
|
304
|
+
```yaml
|
|
305
|
+
dsl: string # DSL entry point path (required)
|
|
306
|
+
bindings: [] # Binding file path list
|
|
307
|
+
active_guardrail_policy: string # Active policy ID
|
|
308
|
+
paths: # Path variables (used as {key} in binding outputs)
|
|
309
|
+
<key>: string
|
|
310
|
+
vars: # Value substitution variables (referenced as ${vars.key} in DSL)
|
|
311
|
+
<key>: string
|
|
312
|
+
renders: # Rendering definitions
|
|
313
|
+
- template: string # Handlebars template path
|
|
314
|
+
context: system | agent | task | artifact | tool | validation | handoff_type | workflow | policy | guardrail | guardrail_policy
|
|
315
|
+
output: string # Output path ({<context>.id} placeholder available)
|
|
316
|
+
include: [] # Target entity IDs (include/exclude are mutually exclusive)
|
|
317
|
+
exclude: [] # Excluded entity IDs
|
|
318
|
+
skip_empty: boolean # Skip file generation on empty output
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
- title: "Merge Operator Reference"
|
|
322
|
+
content: |
|
|
323
|
+
Override base DSL inherited via extends using the following merge operators:
|
|
324
|
+
|
|
325
|
+
| Operator | Behavior | Target |
|
|
326
|
+
|----------|----------|--------|
|
|
327
|
+
| `$append` | Append to end | map / array |
|
|
328
|
+
| `$prepend` | Prepend to start | map / array |
|
|
329
|
+
| `$insert_after` | Insert after specified element | array (identified by id field) |
|
|
330
|
+
| `$replace` | Replace entire value | any |
|
|
331
|
+
| `$remove` | Remove by key/ID | map / array |
|
|
332
|
+
| direct value | Override scalar field | scalar |
|
|
333
|
+
|
|
334
|
+
Maps (agents, tasks, etc.) are automatically deep-merged.
|
|
335
|
+
Defining the same key in the project overrides the base;
|
|
336
|
+
adding a new key extends the base.
|
|
337
|
+
|
|
338
|
+
Arrays (responsibilities, constraints, etc.) are replaced by default
|
|
339
|
+
in the project. Use `$append` / `$prepend` to add to the base array.
|
|
340
|
+
|
|
341
|
+
Examples:
|
|
342
|
+
|
|
343
|
+
```yaml
|
|
344
|
+
# Append a constraint to base implementer
|
|
345
|
+
agents:
|
|
346
|
+
implementer:
|
|
347
|
+
constraints:
|
|
348
|
+
$append:
|
|
349
|
+
- "New constraint appended"
|
|
350
|
+
|
|
351
|
+
# Insert a step after a specific step in base task
|
|
352
|
+
tasks:
|
|
353
|
+
implement-feature:
|
|
354
|
+
execution_steps:
|
|
355
|
+
$insert_after:
|
|
356
|
+
target: run-db-lint
|
|
357
|
+
items:
|
|
358
|
+
- id: run-contract-pipeline
|
|
359
|
+
action: "Run contract pipeline"
|
|
360
|
+
|
|
361
|
+
# Remove an agent from base
|
|
362
|
+
agents:
|
|
363
|
+
$remove:
|
|
364
|
+
- legacy-agent
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Processing order: load → extends merge → vars substitution → schema validation
|
|
368
|
+
|
|
369
|
+
- title: "CLI Command Reference"
|
|
370
|
+
content: |
|
|
371
|
+
| Command | Description |
|
|
372
|
+
|---------|-------------|
|
|
373
|
+
| `npx agent-contracts resolve` | Output extends-resolved YAML |
|
|
374
|
+
| `npx agent-contracts resolve --expand-defaults` | Output with Zod default values expanded |
|
|
375
|
+
| `npx agent-contracts validate` | Schema validation and reference checks |
|
|
376
|
+
| `npx agent-contracts lint` | Semantic lint (--strict treats warnings as errors) |
|
|
377
|
+
| `npx agent-contracts render -c <config>` | Template rendering |
|
|
378
|
+
| `npx agent-contracts render -c <config> --check` | Drift detection (for CI) |
|
|
379
|
+
| `npx agent-contracts score` | Completeness score (7 dimensions) |
|
|
380
|
+
| `npx agent-contracts score --threshold 70` | Exit 1 if below threshold (CI gate) |
|
|
381
|
+
| `npx agent-contracts check -c <config>` | Pipeline: resolve → validate → lint → render --check |
|
|
382
|
+
| `npx agent-contracts generate guardrails` | Generate guardrail runtime artifacts |
|
|
383
|
+
|
|
384
|
+
Common options for all commands:
|
|
385
|
+
- `-c, --config <path>`: Config file path (default: agent-contracts.config.yaml)
|
|
386
|
+
- `--format <text|json>`: Output format
|
|
387
|
+
|
|
388
|
+
### Score 7 Dimensions
|
|
389
|
+
|
|
390
|
+
| Dimension | Measures | Weight |
|
|
391
|
+
|-----------|----------|--------|
|
|
392
|
+
| Artifact validation coverage | Ratio of artifacts with required_validations defined | High |
|
|
393
|
+
| Task validation coverage | Ratio of tasks with validations defined | High |
|
|
394
|
+
| Guardrail policy coverage | Ratio of guardrails referenced in guardrail_policies | Medium |
|
|
395
|
+
| Workflow validation integration | Ratio of blocking validations referenced in workflow/tasks | High |
|
|
396
|
+
| Schema completeness | Fill rate of optional fields (description, rationale, trigger, etc.) | Low |
|
|
397
|
+
| Cross-reference bidirectionality | Bidirectional reference rate between agent↔artifact, agent↔tool | Medium |
|
|
398
|
+
| Guardrail scope resolution | Existence check rate for entities in guardrail scopes | Medium |
|
|
399
|
+
|
|
400
|
+
- title: "Handlebars Template Helpers"
|
|
401
|
+
content: |
|
|
402
|
+
Built-in helpers available in templates:
|
|
403
|
+
|
|
404
|
+
| Helper | Usage | Description |
|
|
405
|
+
|--------|-------|-------------|
|
|
406
|
+
| `eq` | `{{#if (eq a b)}}` | Equality comparison |
|
|
407
|
+
| `notEmpty` | `{{#if (notEmpty obj)}}` | Check if object is non-empty |
|
|
408
|
+
| `inc` | `{{inc @index}}` | 1-based index |
|
|
409
|
+
| `yamlBlock` | `{{{yamlBlock obj}}}` | Render as YAML |
|
|
410
|
+
| `lookupPayloadFields` | `{{#each (lookupPayloadFields schema)}}` | Extract schema fields (resolves allOf) |
|
|
411
|
+
| `join` | `{{join arr ", "}}` | Join array |
|
|
412
|
+
| `contains` | `{{#if (contains arr "x")}}` | Array inclusion check |
|
|
413
|
+
| `groupBy` | `{{#with (groupBy arr "key")}}` | Group by field |
|
|
414
|
+
| `filterByField` | `{{#each (filterByField arr "field" "val")}}` | Filter by field |
|
|
415
|
+
| `keys` / `values` | `{{#each (keys obj)}}` | Object keys/values as array |
|
|
416
|
+
| `size` | `{{size obj}}` | Array length or object key count |
|
|
417
|
+
| `not` | `{{#if (not x)}}` | Negation |
|
|
418
|
+
| `or` / `and` | `{{#if (or a b)}}` | Logical operators (variadic) |
|
|
419
|
+
| `gt` / `gte` / `lt` | `{{#if (gt a b)}}` | Numeric comparison |
|
|
420
|
+
| `sequenceDiagram` | `{{{sequenceDiagram @key ../dsl}}}` | Generate Mermaid sequence diagram |
|
|
421
|
+
| `overviewFlowchart` | `{{{overviewFlowchart dsl}}}` | Generate Mermaid flowchart |
|
|
422
|
+
|
|
423
|
+
Rendering context (agent):
|
|
424
|
+
- `agent` — Agent definition
|
|
425
|
+
- `receivableTasks` — Receivable tasks
|
|
426
|
+
- `delegatableTasks` — Delegatable tasks
|
|
427
|
+
- `relatedArtifacts` — Related artifacts (R/W)
|
|
428
|
+
- `relatedTools` — Related tools
|
|
429
|
+
- `relatedHandoffTypes` — Related handoff types
|
|
430
|
+
- `mergedBehavior` — Merged behavior spec (responsibilities + task-level)
|
|
431
|
+
- `relatedGuardrails` — Related guardrails
|
|
432
|
+
- `relatedValidations` — Related validations
|
|
433
|
+
- `dsl` — Resolved DSL (full)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
dsl-source:
|
|
2
|
+
type: config
|
|
3
|
+
description: >-
|
|
4
|
+
agent-contracts DSL source files — YAML definitions for agents, tasks,
|
|
5
|
+
artifacts, tools, validations, handoff_types, workflow, policies,
|
|
6
|
+
guardrails, guardrail_policies, and bindings.
|
|
7
|
+
owner: dsl-designer
|
|
8
|
+
producers:
|
|
9
|
+
- dsl-designer
|
|
10
|
+
editors:
|
|
11
|
+
- dsl-designer
|
|
12
|
+
consumers:
|
|
13
|
+
- dsl-auditor
|
|
14
|
+
states:
|
|
15
|
+
- draft
|
|
16
|
+
- validated
|
|
17
|
+
- rendered
|
|
18
|
+
required_validations:
|
|
19
|
+
- dsl-schema-validation
|
|
20
|
+
- dsl-lint-validation
|
|
21
|
+
|
|
22
|
+
dsl-generated-output:
|
|
23
|
+
type: doc
|
|
24
|
+
description: >-
|
|
25
|
+
Files generated from DSL via render — agent prompts, overview documents,
|
|
26
|
+
workflow commands, guardrail configurations, etc.
|
|
27
|
+
owner: dsl-designer
|
|
28
|
+
producers:
|
|
29
|
+
- dsl-designer
|
|
30
|
+
editors:
|
|
31
|
+
- dsl-designer
|
|
32
|
+
consumers:
|
|
33
|
+
- dsl-auditor
|
|
34
|
+
states:
|
|
35
|
+
- generated
|
|
36
|
+
- verified
|
|
37
|
+
required_validations:
|
|
38
|
+
- dsl-completeness-audit
|
|
39
|
+
|
|
40
|
+
dsl-score-report:
|
|
41
|
+
type: doc
|
|
42
|
+
description: >-
|
|
43
|
+
Output of agent-contracts score command — completeness evaluation
|
|
44
|
+
across 7 dimensions.
|
|
45
|
+
owner: dsl-designer
|
|
46
|
+
producers:
|
|
47
|
+
- dsl-designer
|
|
48
|
+
editors:
|
|
49
|
+
- dsl-designer
|
|
50
|
+
consumers:
|
|
51
|
+
- dsl-auditor
|
|
52
|
+
states:
|
|
53
|
+
- generated
|
|
54
|
+
required_validations:
|
|
55
|
+
- dsl-score-report-validation
|
|
56
|
+
|
|
57
|
+
dsl-audit-report:
|
|
58
|
+
type: doc
|
|
59
|
+
description: >-
|
|
60
|
+
DSL completeness audit report — PASS/MISS matrix across 19 dimensions,
|
|
61
|
+
gap analysis, and improvement recommendations.
|
|
62
|
+
owner: dsl-auditor
|
|
63
|
+
producers:
|
|
64
|
+
- dsl-auditor
|
|
65
|
+
editors:
|
|
66
|
+
- dsl-auditor
|
|
67
|
+
consumers:
|
|
68
|
+
- dsl-designer
|
|
69
|
+
states:
|
|
70
|
+
- submitted
|
|
71
|
+
required_validations:
|
|
72
|
+
- dsl-audit-report-validation
|
|
73
|
+
x-artifact-class: evidence
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
schemas:
|
|
2
|
+
agent-evidence:
|
|
3
|
+
type: object
|
|
4
|
+
description: Evidence supporting an agent finding.
|
|
5
|
+
required: [kind]
|
|
6
|
+
properties:
|
|
7
|
+
kind:
|
|
8
|
+
type: string
|
|
9
|
+
enum: [file, command, schema, diff, stdout, stderr, text]
|
|
10
|
+
target:
|
|
11
|
+
type: string
|
|
12
|
+
description: Target identifier (file path, command ID, schema name).
|
|
13
|
+
location:
|
|
14
|
+
type: string
|
|
15
|
+
description: Location within the target (line number, JSON pointer).
|
|
16
|
+
excerpt:
|
|
17
|
+
type: string
|
|
18
|
+
description: Relevant excerpt from the target.
|
|
19
|
+
|
|
20
|
+
agent-finding:
|
|
21
|
+
type: object
|
|
22
|
+
description: A single finding from an agent audit or analysis.
|
|
23
|
+
required: [severity, category, message]
|
|
24
|
+
properties:
|
|
25
|
+
id:
|
|
26
|
+
type: string
|
|
27
|
+
description: Unique finding identifier.
|
|
28
|
+
severity:
|
|
29
|
+
type: string
|
|
30
|
+
enum: [info, warning, error, critical]
|
|
31
|
+
category:
|
|
32
|
+
type: string
|
|
33
|
+
description: Finding category (e.g. missing-policy, inconsistent-risk).
|
|
34
|
+
target:
|
|
35
|
+
type: string
|
|
36
|
+
description: Target of the finding (command ID, schema path).
|
|
37
|
+
location:
|
|
38
|
+
type: string
|
|
39
|
+
description: Location within the target.
|
|
40
|
+
message:
|
|
41
|
+
type: string
|
|
42
|
+
recommendation:
|
|
43
|
+
type: string
|
|
44
|
+
confidence:
|
|
45
|
+
type: number
|
|
46
|
+
minimum: 0
|
|
47
|
+
maximum: 1
|
|
48
|
+
description: Confidence score (0-1) for LLM-generated findings.
|
|
49
|
+
evidence:
|
|
50
|
+
type: array
|
|
51
|
+
items:
|
|
52
|
+
$ref: "#/schemas/agent-evidence"
|
|
53
|
+
details:
|
|
54
|
+
type: object
|
|
55
|
+
additionalProperties: true
|
|
56
|
+
|
|
57
|
+
agent-recommended-action:
|
|
58
|
+
type: object
|
|
59
|
+
description: A recommended action from an agent audit.
|
|
60
|
+
required: [kind, title]
|
|
61
|
+
properties:
|
|
62
|
+
kind:
|
|
63
|
+
type: string
|
|
64
|
+
enum: [run_command, edit_file, review, confirm, block, ignore]
|
|
65
|
+
title:
|
|
66
|
+
type: string
|
|
67
|
+
command:
|
|
68
|
+
type: string
|
|
69
|
+
description: CLI command to run (for run_command kind).
|
|
70
|
+
target:
|
|
71
|
+
type: string
|
|
72
|
+
description: Target file or resource.
|
|
73
|
+
rationale:
|
|
74
|
+
type: string
|
|
75
|
+
|
|
76
|
+
agent-audit-result:
|
|
77
|
+
type: object
|
|
78
|
+
description: >-
|
|
79
|
+
Top-level result from an agent audit.
|
|
80
|
+
Canonical schema for agent interoperability across toolchains.
|
|
81
|
+
required: [summary, riskLevel, findings]
|
|
82
|
+
properties:
|
|
83
|
+
summary:
|
|
84
|
+
type: string
|
|
85
|
+
riskLevel:
|
|
86
|
+
type: string
|
|
87
|
+
enum: [low, medium, high, critical]
|
|
88
|
+
findings:
|
|
89
|
+
type: array
|
|
90
|
+
items:
|
|
91
|
+
$ref: "#/schemas/agent-finding"
|
|
92
|
+
recommendedActions:
|
|
93
|
+
type: array
|
|
94
|
+
items:
|
|
95
|
+
$ref: "#/schemas/agent-recommended-action"
|
|
96
|
+
metadata:
|
|
97
|
+
type: object
|
|
98
|
+
properties:
|
|
99
|
+
tool:
|
|
100
|
+
type: string
|
|
101
|
+
command:
|
|
102
|
+
type: string
|
|
103
|
+
version:
|
|
104
|
+
type: string
|
|
105
|
+
generatedAt:
|
|
106
|
+
type: string
|
|
107
|
+
adapter:
|
|
108
|
+
type: string
|
|
109
|
+
model:
|
|
110
|
+
type: string
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
dsl-management-policy:
|
|
2
|
+
description: >-
|
|
3
|
+
Guardrail policy governing DSL management operations.
|
|
4
|
+
Groups all DSL-related guardrails and specifies resolution
|
|
5
|
+
behavior.
|
|
6
|
+
rules:
|
|
7
|
+
- guardrail: dsl-readonly-enforcement
|
|
8
|
+
severity: critical
|
|
9
|
+
action: block
|
|
10
|
+
- guardrail: dsl-validate-before-render
|
|
11
|
+
severity: mandatory
|
|
12
|
+
action: block
|
|
13
|
+
- guardrail: dsl-no-hallucinated-permissions
|
|
14
|
+
severity: critical
|
|
15
|
+
action: block
|
|
16
|
+
escalation:
|
|
17
|
+
target: dsl-designer
|
|
18
|
+
condition: Hallucinated permissions detected in generated prompts
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
dsl-readonly-enforcement:
|
|
2
|
+
description: >-
|
|
3
|
+
Prevent audit-purpose agents from modifying DSL source files.
|
|
4
|
+
dsl-auditor is mode=read-write (to produce dsl-audit-report) but
|
|
5
|
+
must not write to dsl-source. This guardrail enforces that boundary.
|
|
6
|
+
scope:
|
|
7
|
+
agents:
|
|
8
|
+
- dsl-auditor
|
|
9
|
+
artifacts:
|
|
10
|
+
- dsl-source
|
|
11
|
+
rationale: >-
|
|
12
|
+
dsl-auditor uses mode=read-write because it produces dsl-audit-report,
|
|
13
|
+
but its constraints prohibit modifying DSL definitions. This guardrail
|
|
14
|
+
blocks writes to dsl-source from audit-purpose agents.
|
|
15
|
+
|
|
16
|
+
dsl-validate-before-render:
|
|
17
|
+
description: >-
|
|
18
|
+
Ensure DSL validation passes before rendering is attempted.
|
|
19
|
+
Prevents generation of prompts from invalid DSL definitions.
|
|
20
|
+
scope:
|
|
21
|
+
workflows:
|
|
22
|
+
- dsl-update
|
|
23
|
+
tasks:
|
|
24
|
+
- render-dsl-outputs
|
|
25
|
+
artifacts:
|
|
26
|
+
- dsl-generated-output
|
|
27
|
+
rationale: >-
|
|
28
|
+
render-dsl-outputs must not be invoked while validation_result
|
|
29
|
+
of update-dsl-definitions is not 'pass'.
|
|
30
|
+
|
|
31
|
+
dsl-no-hallucinated-permissions:
|
|
32
|
+
description: >-
|
|
33
|
+
Rendered prompts must not grant permissions not declared in DSL.
|
|
34
|
+
Detected via audit-generated-prompts; any hallucinated-permission
|
|
35
|
+
finding of severity critical must be escalated.
|
|
36
|
+
scope:
|
|
37
|
+
artifacts:
|
|
38
|
+
- dsl-generated-output
|
|
39
|
+
tasks:
|
|
40
|
+
- audit-generated-prompts
|
|
41
|
+
tools:
|
|
42
|
+
- agent-contracts-cli
|
|
43
|
+
rationale: >-
|
|
44
|
+
audit-generated-prompts detects permissions or tool references
|
|
45
|
+
in generated prompts that have no corresponding declaration
|
|
46
|
+
in the agent's DSL definition.
|