agent-contracts-runtime 0.31.4 → 0.32.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.
@@ -0,0 +1,187 @@
1
+ implement-request:
2
+ version: 1
3
+ description: Request to implement LLM-powered features in a CLI tool
4
+ schema:
5
+ type: object
6
+ required:
7
+ - description
8
+ - project_dir
9
+ properties:
10
+ description:
11
+ type: string
12
+ description: Description of the LLM feature(s) to implement
13
+ project_dir:
14
+ type: string
15
+ description: Absolute path to the target project directory
16
+ reference_doc:
17
+ type: string
18
+ description: Content of the integrate-llm-commands reference documentation
19
+
20
+ audit-request:
21
+ version: 1
22
+ description: Request to audit an LLM command integration
23
+ schema:
24
+ type: object
25
+ required:
26
+ - project_dir
27
+ properties:
28
+ project_dir:
29
+ type: string
30
+ description: Absolute path to the target project directory
31
+ focus:
32
+ type: string
33
+ description: >-
34
+ Optional focus area (dsl, runtime, cli-contract, architecture, or all).
35
+ Defaults to all.
36
+ enum: [all, dsl, runtime, cli-contract, architecture]
37
+
38
+ audit-result:
39
+ version: 1
40
+ description: >-
41
+ Structured audit result following AgentAuditResult shape.
42
+ Conforms to cli-contracts reference schema.
43
+ schema:
44
+ type: object
45
+ required:
46
+ - summary
47
+ - riskLevel
48
+ - findings
49
+ properties:
50
+ summary:
51
+ type: string
52
+ description: One-paragraph overall assessment
53
+ riskLevel:
54
+ type: string
55
+ enum: [low, medium, high, critical]
56
+ description: >-
57
+ Derived from worst finding: any critical → critical,
58
+ any error → high, any warning → medium, info only → low
59
+ findings:
60
+ type: array
61
+ items:
62
+ type: object
63
+ required:
64
+ - severity
65
+ - category
66
+ - message
67
+ properties:
68
+ id:
69
+ type: string
70
+ description: Unique finding identifier (e.g. AUDIT-001)
71
+ severity:
72
+ type: string
73
+ enum: [info, warning, error, critical]
74
+ category:
75
+ type: string
76
+ description: >-
77
+ One of: dsl-structure, dsl-agent, dsl-task, dsl-handoff,
78
+ dsl-workflow, dsl-guardrail, runtime-adapter,
79
+ runtime-orchestrator, runtime-registry, runtime-handler,
80
+ runtime-plugin, cli-contract-options, cli-contract-xagent,
81
+ cli-contract-exits, cli-contract-schema,
82
+ architecture-modules, architecture-dry-run,
83
+ architecture-context-builder, architecture-agent-coherence,
84
+ architecture-adapter-cwd, architecture-handler,
85
+ architecture-formatter
86
+ target:
87
+ type: string
88
+ description: File path where the issue was found
89
+ location:
90
+ type: string
91
+ description: Line number or section within the file
92
+ message:
93
+ type: string
94
+ description: Concise description of the issue
95
+ recommendation:
96
+ type: string
97
+ description: Concrete fix or remediation step
98
+ confidence:
99
+ type: number
100
+ minimum: 0
101
+ maximum: 1
102
+ description: >-
103
+ 1.0 for pattern match, 0.8+ for structural check,
104
+ 0.5-0.8 for heuristic assessment
105
+ recommendedActions:
106
+ type: array
107
+ items:
108
+ type: object
109
+ required:
110
+ - kind
111
+ - title
112
+ properties:
113
+ kind:
114
+ type: string
115
+ enum: [run_command, edit_file, review, confirm, block, ignore]
116
+ title:
117
+ type: string
118
+ command:
119
+ type: string
120
+ description: CLI command to run (for run_command kind)
121
+ target:
122
+ type: string
123
+ description: Target file or resource
124
+ rationale:
125
+ type: string
126
+ metadata:
127
+ type: object
128
+ properties:
129
+ tool:
130
+ type: string
131
+ command:
132
+ type: string
133
+ version:
134
+ type: string
135
+ generatedAt:
136
+ type: string
137
+ adapter:
138
+ type: string
139
+ model:
140
+ type: string
141
+
142
+ implementation-result:
143
+ version: 1
144
+ description: Result of the LLM feature implementation
145
+ schema:
146
+ type: object
147
+ required:
148
+ - files_created
149
+ - files_modified
150
+ - summary
151
+ properties:
152
+ files_created:
153
+ type: array
154
+ items:
155
+ type: string
156
+ description: List of newly created files
157
+ files_modified:
158
+ type: array
159
+ items:
160
+ type: string
161
+ description: List of modified existing files
162
+ summary:
163
+ type: string
164
+ description: Human-readable summary of the implementation
165
+ commands_added:
166
+ type: array
167
+ items:
168
+ type: object
169
+ required:
170
+ - name
171
+ - type
172
+ properties:
173
+ name:
174
+ type: string
175
+ description: Command name
176
+ type:
177
+ type: string
178
+ enum: [audit, propose, explain]
179
+ description: Command type
180
+ description:
181
+ type: string
182
+ description: Command description
183
+ next_steps:
184
+ type: array
185
+ items:
186
+ type: string
187
+ description: Recommended next steps for the developer
@@ -0,0 +1,119 @@
1
+ version: 1
2
+
3
+ system:
4
+ id: agent-runtime-builtin
5
+ name: "agent-runtime Built-in Agents"
6
+ default_workflow_order:
7
+ - implement-llm-feature
8
+ - audit-implementation
9
+
10
+ agents: { $ref: "./agents/" }
11
+ tasks: { $ref: "./tasks.yaml" }
12
+ handoff_types: { $ref: "./handoff-types.yaml" }
13
+
14
+ guardrails:
15
+ output-schema-conformance:
16
+ description: >-
17
+ Ensure all agent outputs conform to their respective handoff
18
+ schemas. Validation is performed at runtime via Zod.
19
+ scope:
20
+ agents:
21
+ - llm-feature-implementer
22
+ - implementation-auditor
23
+ tasks:
24
+ - implement-llm-feature
25
+ - audit-dsl
26
+ - audit-runtime
27
+ - audit-cli-contract
28
+ - audit-architecture
29
+ - audit-merge
30
+ rationale: >-
31
+ Structured output conformance is critical for CLI parsing
32
+ and downstream tooling integration.
33
+
34
+ no-direct-api-call:
35
+ description: >-
36
+ The implementer agent must not generate code that calls LLM APIs
37
+ directly. All LLM invocations must go through agent-contracts-runtime
38
+ runWorkflow().
39
+ scope:
40
+ agents:
41
+ - llm-feature-implementer
42
+ rationale: >-
43
+ Preserves SDK adapter abstraction, enabling adapter swap,
44
+ plugin hooks, and guardrail enforcement.
45
+
46
+ audit-read-only:
47
+ description: >-
48
+ The auditor agent must not create, modify, or delete any files.
49
+ It operates in read-only mode and produces findings only.
50
+ scope:
51
+ agents:
52
+ - implementation-auditor
53
+ rationale: >-
54
+ Audit results must be reviewed by the developer before changes
55
+ are applied. The auditor observes; the developer decides.
56
+
57
+ guardrail_policies:
58
+ implement-safety-policy:
59
+ description: Guardrail policy for the LLM feature implementation agent
60
+ rules:
61
+ - guardrail: output-schema-conformance
62
+ severity: critical
63
+ action: block
64
+ - guardrail: no-direct-api-call
65
+ severity: critical
66
+ action: block
67
+
68
+ audit-safety-policy:
69
+ description: Guardrail policy for the implementation auditor agent
70
+ rules:
71
+ - guardrail: output-schema-conformance
72
+ severity: critical
73
+ action: block
74
+ - guardrail: audit-read-only
75
+ severity: critical
76
+ action: block
77
+
78
+ workflow:
79
+ implement-llm-feature:
80
+ description: "Implement LLM-powered commands in a CLI tool"
81
+ trigger: cli-command
82
+ entry_conditions:
83
+ - "Target project is a TypeScript / Node.js project"
84
+ - "cli-contract.yaml exists or is being created"
85
+ steps:
86
+ - type: delegate
87
+ task: implement-llm-feature
88
+ from_agent: llm-feature-implementer
89
+
90
+ audit-implementation:
91
+ description: "Audit an LLM command integration for pattern conformance"
92
+ trigger: cli-command
93
+ entry_conditions:
94
+ - "Target project has LLM command integration to audit"
95
+ steps:
96
+ - type: delegate
97
+ task: audit-dsl
98
+ from_agent: implementation-auditor
99
+ depends_on: []
100
+ - type: delegate
101
+ task: audit-runtime
102
+ from_agent: implementation-auditor
103
+ depends_on: []
104
+ - type: delegate
105
+ task: audit-cli-contract
106
+ from_agent: implementation-auditor
107
+ depends_on: []
108
+ - type: delegate
109
+ task: audit-architecture
110
+ from_agent: implementation-auditor
111
+ depends_on: []
112
+ - type: delegate
113
+ task: audit-merge
114
+ from_agent: implementation-auditor
115
+ depends_on:
116
+ - audit-dsl
117
+ - audit-runtime
118
+ - audit-cli-contract
119
+ - audit-architecture