@bluefly/openstandardagents 0.2.8 → 0.2.9

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.
Files changed (112) hide show
  1. package/.env.example +1 -1
  2. package/.github/AGENTS.md +245 -0
  3. package/.github/agents/github-issue-triage.ossa.yaml +99 -0
  4. package/.github/agents/github-pr-triage.ossa.yaml +137 -0
  5. package/.github/workflows/issue-sync-to-gitlab.yml +138 -0
  6. package/.github/workflows/pr-triage-to-gitlab.yml +164 -0
  7. package/.version.json +1 -1
  8. package/.wiki-config.json +1 -1
  9. package/CHANGELOG.md +33 -0
  10. package/CONTRIBUTING.md +102 -3
  11. package/README.md +17 -10
  12. package/dist/services/release-automation/schemas/release.schema.js +1 -1
  13. package/dist/services/release-automation/webhook.service.js +3 -3
  14. package/dist/services/release-automation/webhook.service.js.map +1 -1
  15. package/dist/services/runtime/claude/claude-adapter.d.ts +1 -1
  16. package/dist/services/runtime/claude/claude-adapter.d.ts.map +1 -1
  17. package/dist/services/runtime/claude/claude-adapter.js +1 -1
  18. package/dist/services/runtime/claude/claude-adapter.js.map +1 -1
  19. package/dist/spec/v0.2.9/a2a-protocol.md +1337 -0
  20. package/dist/spec/v0.2.9/agent.md +1946 -0
  21. package/dist/spec/v0.2.9/capabilities/index.yaml +25 -0
  22. package/dist/spec/v0.2.9/capabilities/memory.yaml +251 -0
  23. package/dist/spec/v0.2.9/capability-schema.md +576 -0
  24. package/dist/spec/v0.2.9/compliance-profiles.md +533 -0
  25. package/dist/spec/v0.2.9/conformance-testing.md +1527 -0
  26. package/dist/spec/v0.2.9/gitlab-duo-integration.md +621 -0
  27. package/dist/spec/v0.2.9/ossa-0.2.9.schema.json +3699 -0
  28. package/dist/spec/v0.2.9/runtime-semantics.md +464 -0
  29. package/dist/spec/v0.2.9/security-model.md +1245 -0
  30. package/dist/spec/v0.2.9/semantic-conventions.md +347 -0
  31. package/dist/spec/v0.2.9/types.ts +522 -0
  32. package/dist/types/policy.d.ts +377 -0
  33. package/dist/types/policy.d.ts.map +1 -0
  34. package/dist/types/policy.js +84 -0
  35. package/dist/types/policy.js.map +1 -0
  36. package/dist/utils/version.js +1 -1
  37. package/docs/specs/policy-dsl.md +925 -0
  38. package/examples/adk-integration/code-review-workflow.yml +1 -1
  39. package/examples/adk-integration/customer-support.yml +1 -1
  40. package/examples/adk-integration/data-pipeline.yml +1 -1
  41. package/examples/advanced/reasoning-agent.yaml +136 -0
  42. package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
  43. package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
  44. package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
  45. package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
  46. package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
  47. package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
  48. package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
  49. package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
  50. package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
  51. package/examples/agents-md/code-agent.ossa.json +100 -0
  52. package/examples/agents-md/monorepo-agent.ossa.yaml +180 -0
  53. package/examples/anthropic/claude-assistant.ossa.json +1 -1
  54. package/examples/autogen/multi-agent.ossa.json +1 -1
  55. package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
  56. package/examples/claude-code/ossa-validator.ossa.yaml +2 -2
  57. package/examples/common_npm/agent-router.ossa.yaml +1 -1
  58. package/examples/common_npm/agent-router.v0.2.2.ossa.yaml +1 -1
  59. package/examples/crewai/research-team.ossa.json +1 -1
  60. package/examples/cursor/code-review-agent.ossa.json +1 -1
  61. package/examples/drupal/gitlab-ml-recommender.ossa.yaml +1 -1
  62. package/examples/drupal/gitlab-ml-recommender.v0.2.2.ossa.yaml +1 -1
  63. package/examples/extensions/agents-md-v1.yml +175 -0
  64. package/examples/extensions/drupal-v1.yml +1 -1
  65. package/examples/extensions/kagent-v1.yml +1 -1
  66. package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
  67. package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +4 -4
  68. package/examples/kagent/compliance-validator.ossa.yaml +1 -1
  69. package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
  70. package/examples/kagent/documentation-agent.ossa.yaml +1 -1
  71. package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +1 -1
  72. package/examples/kagent/k8s-troubleshooter-v1.v0.2.2.ossa.yaml +1 -1
  73. package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
  74. package/examples/kagent/security-scanner.ossa.yaml +1 -1
  75. package/examples/langchain/chain-agent.ossa.json +1 -1
  76. package/examples/langflow/workflow-agent.ossa.json +1 -1
  77. package/examples/langgraph/state-machine-agent.ossa.json +1 -1
  78. package/examples/llamaindex/rag-agent.ossa.json +1 -1
  79. package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
  80. package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
  81. package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
  82. package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
  83. package/examples/openai/basic-agent.ossa.yaml +1 -1
  84. package/examples/openai/multi-tool-agent.ossa.json +1 -1
  85. package/examples/openai/swarm-agent.ossa.json +1 -1
  86. package/examples/production/document-analyzer-openai.yml +1 -1
  87. package/examples/quickstart/support-agent.ossa.yaml +1 -1
  88. package/examples/templates/ossa-compliance.yaml +1 -1
  89. package/examples/vercel/edge-agent.ossa.json +1 -1
  90. package/llms.txt +1 -1
  91. package/package.json +5 -3
  92. package/scripts/README.md +25 -0
  93. package/scripts/compliance-audit.ts +796 -0
  94. package/scripts/generate-agents-catalog.ts +2 -1
  95. package/scripts/generate-api-docs.ts +2 -1
  96. package/scripts/generate-examples-docs.ts +2 -1
  97. package/scripts/generate-llms-ctx.sh +2 -2
  98. package/spec/v0.2.9/a2a-protocol.md +1337 -0
  99. package/spec/v0.2.9/agent.md +1946 -0
  100. package/spec/v0.2.9/capabilities/index.yaml +25 -0
  101. package/spec/v0.2.9/capabilities/memory.yaml +251 -0
  102. package/spec/v0.2.9/capability-schema.md +576 -0
  103. package/spec/v0.2.9/compliance-profiles.md +533 -0
  104. package/spec/v0.2.9/conformance-testing.md +1527 -0
  105. package/spec/v0.2.9/gitlab-duo-integration.md +621 -0
  106. package/spec/v0.2.9/ossa-0.2.9.schema.json +3699 -0
  107. package/spec/v0.2.9/runtime-semantics.md +464 -0
  108. package/spec/v0.2.9/security-model.md +1245 -0
  109. package/spec/v0.2.9/semantic-conventions.md +347 -0
  110. package/spec/v0.2.9/types.ts +522 -0
  111. package/test-results/junit.xml +184 -146
  112. package/.github/workflows/pr-comment.yml +0 -33
@@ -0,0 +1,1527 @@
1
+ # OSSA Conformance Testing Specification
2
+
3
+ **Version**: 0.2.9
4
+ **Status**: Draft
5
+ **Last Updated**: 2025-12-04
6
+
7
+ This document defines conformance testing requirements and procedures for OSSA-compliant agents and runtimes.
8
+
9
+ ## Overview
10
+
11
+ Conformance testing ensures OSSA implementations meet specification requirements. Three conformance levels provide progressive validation from basic schema compliance to enterprise-grade security and compliance.
12
+
13
+ ```bash
14
+ # Quick conformance check
15
+ ossa validate agent.yml # Basic level
16
+ ossa validate agent.yml --level=standard # Standard level
17
+ ossa validate agent.yml --level=enterprise # Enterprise level
18
+ ```
19
+
20
+ ---
21
+
22
+ ## 1. Conformance Levels
23
+
24
+ ### 1.1 Basic Conformance
25
+
26
+ **Requirements**:
27
+ - ✅ Schema validation passes
28
+ - ✅ All required fields present
29
+ - ✅ Valid URIs and references
30
+ - ✅ Semantic version format
31
+
32
+ **Validates**:
33
+ - YAML/JSON structure
34
+ - Data types and enums
35
+ - Required vs optional fields
36
+ - URI format and reachability
37
+
38
+ **Time to Validate**: < 1 second
39
+
40
+ ```bash
41
+ ossa validate agent.yml --level=basic
42
+ ```
43
+
44
+ **Output**:
45
+ ```
46
+ ✓ Schema validation passed
47
+ ✓ All required fields present (apiVersion, kind, metadata, spec)
48
+ ✓ Valid semantic version: 0.2.9
49
+ ✓ All capability URIs reachable
50
+ ✓ Tool schemas valid JSON Schema Draft-07
51
+
52
+ Basic Conformance: PASSED
53
+ ```
54
+
55
+ ### 1.2 Standard Conformance
56
+
57
+ **Requirements**:
58
+ - ✅ All Basic requirements
59
+ - ✅ Runtime semantics compliance
60
+ - ✅ Error handling implemented
61
+ - ✅ State management correct
62
+ - ✅ Turn lifecycle adherence
63
+
64
+ **Validates**:
65
+ - Turn lifecycle phases (7 phases)
66
+ - Error code handling
67
+ - State isolation levels
68
+ - Tool execution semantics
69
+ - Observability emissions
70
+
71
+ **Time to Validate**: 10-30 seconds (includes runtime tests)
72
+
73
+ ```bash
74
+ ossa validate agent.yml --level=standard
75
+ ```
76
+
77
+ **Output**:
78
+ ```
79
+ ✓ Basic conformance passed
80
+ ✓ Turn lifecycle: All 7 phases implemented
81
+ ✓ Error handling: 14/14 error codes handled
82
+ ✓ State isolation: serializable level supported
83
+ ✓ Tool execution: Parallel and sequential modes
84
+ ✓ Observability: OpenTelemetry spans emitted
85
+
86
+ Standard Conformance: PASSED
87
+ ```
88
+
89
+ ### 1.3 Enterprise Conformance
90
+
91
+ **Requirements**:
92
+ - ✅ All Standard requirements
93
+ - ✅ Security model enforced
94
+ - ✅ Compliance profile validated
95
+ - ✅ Audit logging complete
96
+ - ✅ Encryption at rest/transit
97
+
98
+ **Validates**:
99
+ - FedRAMP/SOC2/HIPAA controls
100
+ - Audit log retention
101
+ - Encryption algorithms
102
+ - Authentication mechanisms
103
+ - Data residency compliance
104
+
105
+ **Time to Validate**: 1-5 minutes (includes security scans)
106
+
107
+ ```bash
108
+ ossa validate agent.yml --level=enterprise --profile=fedramp-moderate
109
+ ```
110
+
111
+ **Output**:
112
+ ```
113
+ ✓ Standard conformance passed
114
+ ✓ Security: TLS 1.3, AES-256-GCM encryption
115
+ ✓ Compliance: FedRAMP Moderate (110/110 controls)
116
+ ✓ Audit logging: Enabled, 7-year retention
117
+ ✓ Authentication: mTLS configured
118
+ ✓ Data residency: US regions only
119
+
120
+ Enterprise Conformance: PASSED (FedRAMP Moderate)
121
+ ```
122
+
123
+ ---
124
+
125
+ ## 2. Test Categories
126
+
127
+ ### 2.1 Schema Tests
128
+
129
+ **Purpose**: Validate manifest structure and data types.
130
+
131
+ ```typescript
132
+ interface SchemaTest {
133
+ name: string;
134
+ description: string;
135
+ input: string; // Path to manifest file
136
+ expected: 'pass' | 'fail';
137
+ error_code?: string;
138
+ }
139
+ ```
140
+
141
+ **Test Cases**:
142
+ 1. Valid minimal worker agent
143
+ 2. Valid supervisor with delegation
144
+ 3. Missing required field (apiVersion)
145
+ 4. Invalid semantic version
146
+ 5. Invalid tool schema
147
+ 6. Unknown capability URI
148
+ 7. Malformed YAML syntax
149
+ 8. Invalid enum value
150
+ 9. Negative timeout value
151
+ 10. Circular delegation reference
152
+
153
+ ### 2.2 Runtime Tests
154
+
155
+ **Purpose**: Validate runtime behavior and semantics.
156
+
157
+ ```typescript
158
+ interface RuntimeTest {
159
+ name: string;
160
+ description: string;
161
+ agent: string; // Path to manifest
162
+ scenario: TestScenario;
163
+ assertions: Assertion[];
164
+ }
165
+
166
+ interface TestScenario {
167
+ input: Message[];
168
+ expected_turns: number;
169
+ expected_tool_calls: ToolCall[];
170
+ expected_state_changes: StateChange[];
171
+ }
172
+ ```
173
+
174
+ **Test Cases**:
175
+ 1. Single-turn interaction
176
+ 2. Multi-turn conversation
177
+ 3. Tool execution with retry
178
+ 4. State persistence across turns
179
+ 5. Error recovery (TOOL_ERROR)
180
+ 6. Circuit breaker activation
181
+ 7. Max turns limit enforcement
182
+ 8. Token limit enforcement
183
+ 9. Delegation handoff
184
+ 10. Parallel tool execution
185
+
186
+ ### 2.3 Security Tests
187
+
188
+ **Purpose**: Validate security controls and practices.
189
+
190
+ ```typescript
191
+ interface SecurityTest {
192
+ name: string;
193
+ description: string;
194
+ agent: string;
195
+ vulnerability: string;
196
+ expected: 'blocked' | 'detected' | 'logged';
197
+ }
198
+ ```
199
+
200
+ **Test Cases**:
201
+ 1. No secrets in manifest
202
+ 2. Authentication configured for external tools
203
+ 3. Sandbox escape attempt blocked
204
+ 4. PII redaction in logs
205
+ 5. Encryption at rest enabled
206
+ 6. TLS 1.3 for all connections
207
+ 7. Content filtering blocks harmful prompts
208
+ 8. API key rotation enforced
209
+ 9. RBAC for privileged tools
210
+ 10. Session timeout enforcement
211
+
212
+ ### 2.4 Interoperability Tests
213
+
214
+ **Purpose**: Validate cross-framework compatibility.
215
+
216
+ ```typescript
217
+ interface InteropTest {
218
+ name: string;
219
+ description: string;
220
+ source_agent: string;
221
+ target_framework: 'langchain' | 'autogen' | 'crewai' | 'anthropic';
222
+ protocol: 'a2a' | 'mcp' | 'rest';
223
+ expected: 'success' | 'graceful_degradation';
224
+ }
225
+ ```
226
+
227
+ **Test Cases**:
228
+ 1. A2A protocol handshake
229
+ 2. Capability negotiation
230
+ 3. Message format translation
231
+ 4. Context propagation
232
+ 5. Error code mapping
233
+ 6. State isolation across frameworks
234
+ 7. Observability trace linking
235
+ 8. Tool schema compatibility
236
+ 9. Authentication credential passing
237
+ 10. Graceful degradation on unsupported features
238
+
239
+ ---
240
+
241
+ ## 3. Test Fixtures
242
+
243
+ Test fixtures are located in `spec/v0.2.9/fixtures/` directory.
244
+
245
+ ### 3.1 Basic Level Fixtures
246
+
247
+ #### fixtures/basic/valid-worker.yml
248
+
249
+ ```yaml
250
+ apiVersion: ossa/v0.2.9
251
+ kind: Agent
252
+ metadata:
253
+ name: test-worker
254
+ version: 1.0.0
255
+ spec:
256
+ role: "You are a test agent for conformance validation"
257
+ capabilities:
258
+ - urn:ossa:capability:chat
259
+ llm:
260
+ provider: openai
261
+ model: gpt-4o-mini
262
+ tools: []
263
+ ```
264
+
265
+ #### fixtures/basic/invalid-missing-version.yml
266
+
267
+ ```yaml
268
+ apiVersion: ossa/v0.2.9
269
+ kind: Agent
270
+ metadata:
271
+ name: test-invalid
272
+ # version field missing - should fail validation
273
+ spec:
274
+ role: "Test agent with missing version"
275
+ capabilities:
276
+ - urn:ossa:capability:chat
277
+ llm:
278
+ provider: openai
279
+ model: gpt-4o-mini
280
+ ```
281
+
282
+ #### fixtures/basic/invalid-bad-semver.yml
283
+
284
+ ```yaml
285
+ apiVersion: ossa/v0.2.9
286
+ kind: Agent
287
+ metadata:
288
+ name: test-bad-version
289
+ version: "1.0" # Invalid semver - missing patch version
290
+ spec:
291
+ role: "Test agent with invalid semantic version"
292
+ capabilities:
293
+ - urn:ossa:capability:chat
294
+ llm:
295
+ provider: openai
296
+ model: gpt-4o-mini
297
+ ```
298
+
299
+ #### fixtures/basic/invalid-unknown-capability.yml
300
+
301
+ ```yaml
302
+ apiVersion: ossa/v0.2.9
303
+ kind: Agent
304
+ metadata:
305
+ name: test-unknown-cap
306
+ version: 1.0.0
307
+ spec:
308
+ role: "Test agent with unknown capability"
309
+ capabilities:
310
+ - urn:ossa:capability:unknown:foobar # Unknown capability
311
+ llm:
312
+ provider: openai
313
+ model: gpt-4o-mini
314
+ ```
315
+
316
+ #### fixtures/basic/invalid-malformed-yaml.yml
317
+
318
+ ```yaml
319
+ apiVersion: ossa/v0.2.9
320
+ kind: Agent
321
+ metadata:
322
+ name: test-malformed
323
+ version: 1.0.0
324
+ spec:
325
+ role: "Test agent"
326
+ capabilities:
327
+ - urn:ossa:capability:chat
328
+ llm:
329
+ provider: openai
330
+ model: gpt-4o-mini
331
+ tools:
332
+ - name: test_tool
333
+ description: "Test tool"
334
+ # Missing closing quote - malformed YAML
335
+ input_schema: { "type": "object
336
+ ```
337
+
338
+ ### 3.2 Standard Level Fixtures
339
+
340
+ #### fixtures/standard/runtime-compliant.yml
341
+
342
+ ```yaml
343
+ apiVersion: ossa/v0.2.9
344
+ kind: Agent
345
+ metadata:
346
+ name: runtime-test
347
+ version: 1.0.0
348
+ spec:
349
+ role: "Agent for runtime semantics testing"
350
+ capabilities:
351
+ - urn:ossa:capability:chat
352
+ - urn:ossa:capability:tools
353
+
354
+ llm:
355
+ provider: openai
356
+ model: gpt-4o
357
+ parameters:
358
+ temperature: 0.7
359
+ max_tokens: 2000
360
+
361
+ constraints:
362
+ max_turns: 20
363
+ max_tokens: 100000
364
+ timeout_seconds: 300
365
+
366
+ tools:
367
+ - name: calculator
368
+ description: "Perform basic arithmetic"
369
+ input_schema:
370
+ type: object
371
+ properties:
372
+ operation:
373
+ type: string
374
+ enum: [add, subtract, multiply, divide]
375
+ a:
376
+ type: number
377
+ b:
378
+ type: number
379
+ required: [operation, a, b]
380
+ source:
381
+ type: function
382
+ implementation: |
383
+ function calculator(input) {
384
+ const { operation, a, b } = input;
385
+ switch (operation) {
386
+ case 'add': return a + b;
387
+ case 'subtract': return a - b;
388
+ case 'multiply': return a * b;
389
+ case 'divide': return a / b;
390
+ default: throw new Error('Unknown operation');
391
+ }
392
+ }
393
+
394
+ state:
395
+ enabled: true
396
+ isolation_level: serializable
397
+ ttl: 3600
398
+
399
+ reliability:
400
+ retry:
401
+ enabled: true
402
+ max_attempts: 3
403
+ backoff_ms: 1000
404
+ circuit_breaker:
405
+ enabled: true
406
+ failure_threshold: 5
407
+ timeout_ms: 30000
408
+ half_open_after_ms: 60000
409
+
410
+ observability:
411
+ logging:
412
+ enabled: true
413
+ level: info
414
+ structured: true
415
+ tracing:
416
+ enabled: true
417
+ provider: opentelemetry
418
+ metrics:
419
+ enabled: true
420
+ provider: prometheus
421
+ ```
422
+
423
+ #### fixtures/standard/error-handling.yml
424
+
425
+ ```yaml
426
+ apiVersion: ossa/v0.2.9
427
+ kind: Agent
428
+ metadata:
429
+ name: error-handler-test
430
+ version: 1.0.0
431
+ spec:
432
+ role: "Agent for error handling validation"
433
+ capabilities:
434
+ - urn:ossa:capability:chat
435
+ - urn:ossa:capability:tools
436
+
437
+ llm:
438
+ provider: openai
439
+ model: gpt-4o-mini
440
+
441
+ tools:
442
+ - name: flaky_tool
443
+ description: "Tool that fails intermittently"
444
+ input_schema:
445
+ type: object
446
+ properties:
447
+ fail_probability:
448
+ type: number
449
+ minimum: 0
450
+ maximum: 1
451
+ required: [fail_probability]
452
+ source:
453
+ type: function
454
+ implementation: |
455
+ function flaky_tool(input) {
456
+ if (Math.random() < input.fail_probability) {
457
+ throw new Error('TOOL_ERROR: Random failure');
458
+ }
459
+ return { success: true };
460
+ }
461
+
462
+ reliability:
463
+ retry:
464
+ enabled: true
465
+ max_attempts: 3
466
+ backoff_ms: 500
467
+ fallback:
468
+ on_error:
469
+ - error_code: TOOL_ERROR
470
+ strategy: retry
471
+ max_retries: 3
472
+ - error_code: TOOL_TIMEOUT
473
+ strategy: fallback
474
+ fallback_value: { error: true, message: "Tool timed out" }
475
+ - error_code: MAX_TURNS_EXCEEDED
476
+ strategy: escalate
477
+ escalation_target: human
478
+ ```
479
+
480
+ #### fixtures/standard/state-management.yml
481
+
482
+ ```yaml
483
+ apiVersion: ossa/v0.2.9
484
+ kind: Agent
485
+ metadata:
486
+ name: state-test
487
+ version: 1.0.0
488
+ spec:
489
+ role: "Agent for state management testing"
490
+ capabilities:
491
+ - urn:ossa:capability:chat
492
+ - urn:ossa:capability:stateful
493
+
494
+ llm:
495
+ provider: openai
496
+ model: gpt-4o-mini
497
+
498
+ state:
499
+ enabled: true
500
+ isolation_level: serializable
501
+ encryption:
502
+ enabled: true
503
+ algorithm: AES-256-GCM
504
+ ttl: 7200
505
+ storage:
506
+ backend: redis
507
+ uri: redis://localhost:6379/0
508
+ key_prefix: "ossa:test:"
509
+
510
+ tools:
511
+ - name: get_counter
512
+ description: "Get current counter value"
513
+ input_schema:
514
+ type: object
515
+ properties: {}
516
+ source:
517
+ type: function
518
+ implementation: |
519
+ async function get_counter() {
520
+ const value = await state.get('counter') || 0;
521
+ return { counter: value };
522
+ }
523
+
524
+ - name: increment_counter
525
+ description: "Increment counter"
526
+ input_schema:
527
+ type: object
528
+ properties:
529
+ amount:
530
+ type: number
531
+ default: 1
532
+ source:
533
+ type: function
534
+ implementation: |
535
+ async function increment_counter(input) {
536
+ const current = await state.get('counter') || 0;
537
+ const new_value = current + (input.amount || 1);
538
+ await state.set('counter', new_value);
539
+ return { counter: new_value };
540
+ }
541
+ ```
542
+
543
+ ### 3.3 Enterprise Level Fixtures
544
+
545
+ #### fixtures/enterprise/fedramp-compliant.yml
546
+
547
+ ```yaml
548
+ apiVersion: ossa/v0.2.9
549
+ kind: Agent
550
+ metadata:
551
+ name: fedramp-agent
552
+ version: 1.0.0
553
+ annotations:
554
+ compliance.framework: FedRAMP
555
+ compliance.level: Moderate
556
+ dpia.completed: "true"
557
+ dpia.date: "2025-01-15"
558
+
559
+ spec:
560
+ role: "FedRAMP Moderate compliant agent"
561
+ capabilities:
562
+ - urn:ossa:capability:chat
563
+ - urn:ossa:capability:tools
564
+
565
+ compliance:
566
+ profiles:
567
+ - fedramp-moderate
568
+ audit:
569
+ enabled: true
570
+ retention_days: 2555 # 7 years
571
+ immutable: true
572
+
573
+ llm:
574
+ provider: openai
575
+ model: gpt-4o
576
+ parameters:
577
+ temperature: 0.7
578
+
579
+ security:
580
+ authentication:
581
+ required: true
582
+ type: mtls
583
+ mfa_required: true
584
+ authorization:
585
+ rbac:
586
+ enabled: true
587
+ roles:
588
+ - name: analyst
589
+ permissions: [read, execute]
590
+ - name: admin
591
+ permissions: [read, write, execute, delete]
592
+
593
+ state:
594
+ enabled: true
595
+ isolation_level: serializable
596
+ encryption:
597
+ enabled: true
598
+ algorithm: AES-256-GCM
599
+ key_management: FIPS-140-2
600
+ at_rest: true
601
+ in_transit: true
602
+ storage:
603
+ backend: aws-dynamodb
604
+ region: us-gov-west-1
605
+ data_residency: US
606
+
607
+ tools:
608
+ - name: query_database
609
+ description: "Query federal database"
610
+ input_schema:
611
+ type: object
612
+ properties:
613
+ query:
614
+ type: string
615
+ source:
616
+ type: http
617
+ uri: https://api.example.gov/query
618
+ method: POST
619
+ tls:
620
+ enabled: true
621
+ min_version: "1.3"
622
+ client_cert_required: true
623
+ authentication:
624
+ type: mtls
625
+ cert_path: /etc/certs/client.pem
626
+ key_path: /etc/certs/client.key
627
+ approval_required: true
628
+
629
+ observability:
630
+ logging:
631
+ enabled: true
632
+ level: info
633
+ structured: true
634
+ immutable: true
635
+ pii_redaction: true
636
+ retention_days: 2555
637
+ tracing:
638
+ enabled: true
639
+ provider: opentelemetry
640
+ pii_redaction: true
641
+ metrics:
642
+ enabled: true
643
+ provider: prometheus
644
+
645
+ reliability:
646
+ retry:
647
+ enabled: true
648
+ max_attempts: 3
649
+ backoff_ms: 1000
650
+ circuit_breaker:
651
+ enabled: true
652
+ failure_threshold: 3
653
+ timeout_ms: 30000
654
+ ```
655
+
656
+ #### fixtures/enterprise/hipaa-compliant.yml
657
+
658
+ ```yaml
659
+ apiVersion: ossa/v0.2.9
660
+ kind: Agent
661
+ metadata:
662
+ name: healthcare-agent
663
+ version: 1.0.0
664
+ annotations:
665
+ compliance.framework: HIPAA
666
+ baa.signed: "true"
667
+ baa.date: "2025-01-01"
668
+ workforce.training: "completed"
669
+
670
+ spec:
671
+ role: "HIPAA-compliant healthcare assistant"
672
+ capabilities:
673
+ - urn:ossa:capability:chat
674
+ - urn:ossa:capability:phi
675
+
676
+ compliance:
677
+ profiles:
678
+ - hipaa
679
+ audit:
680
+ enabled: true
681
+ retention_days: 2190 # 6 years
682
+ phi_access_logging: true
683
+ immutable: true
684
+
685
+ llm:
686
+ provider: openai
687
+ model: gpt-4o
688
+ parameters:
689
+ temperature: 0.3
690
+
691
+ security:
692
+ authentication:
693
+ required: true
694
+ type: oauth2
695
+ mfa_required: true
696
+ authorization:
697
+ phi_access:
698
+ minimum_necessary: true
699
+ access_justification: required
700
+ audit_all_access: true
701
+
702
+ safety:
703
+ content_filtering:
704
+ enabled: true
705
+ phi_detection: true
706
+ phi_redaction: true
707
+
708
+ state:
709
+ enabled: true
710
+ isolation_level: serializable
711
+ encryption:
712
+ enabled: true
713
+ algorithm: AES-256-GCM
714
+ phi_specific: true
715
+ at_rest: true
716
+ in_transit: true
717
+ storage:
718
+ backend: postgresql
719
+ phi_isolation: true
720
+ access_logging: true
721
+ retention:
722
+ minimum_days: 2190
723
+
724
+ tools:
725
+ - name: lookup_patient
726
+ description: "Lookup patient information"
727
+ input_schema:
728
+ type: object
729
+ properties:
730
+ patient_id:
731
+ type: string
732
+ pattern: "^[0-9]{8}$"
733
+ required: [patient_id]
734
+ source:
735
+ type: http
736
+ uri: https://ehr.example.com/api/patients
737
+ method: GET
738
+ tls:
739
+ enabled: true
740
+ min_version: "1.2"
741
+ authentication:
742
+ type: oauth2
743
+ token_endpoint: https://auth.example.com/token
744
+ approval_required: true
745
+ phi_handling:
746
+ contains_phi: true
747
+ minimum_necessary: true
748
+ access_justification: required
749
+
750
+ observability:
751
+ logging:
752
+ enabled: true
753
+ level: info
754
+ structured: true
755
+ immutable: true
756
+ phi_redaction: mandatory
757
+ phi_access_logging: true
758
+ retention_days: 2190
759
+ tracing:
760
+ enabled: true
761
+ provider: opentelemetry
762
+ phi_redaction: mandatory
763
+ ```
764
+
765
+ #### fixtures/enterprise/soc2-compliant.yml
766
+
767
+ ```yaml
768
+ apiVersion: ossa/v0.2.9
769
+ kind: Agent
770
+ metadata:
771
+ name: soc2-agent
772
+ version: 1.0.0
773
+ annotations:
774
+ compliance.framework: SOC2
775
+ compliance.type: Type-II
776
+ soc2.report.date: "2025-01-01"
777
+
778
+ spec:
779
+ role: "SOC 2 Type II compliant agent"
780
+ capabilities:
781
+ - urn:ossa:capability:chat
782
+ - urn:ossa:capability:tools
783
+
784
+ compliance:
785
+ profiles:
786
+ - soc2-type2
787
+ audit:
788
+ enabled: true
789
+ retention_days: 365
790
+ tamper_evident: true
791
+
792
+ llm:
793
+ provider: openai
794
+ model: gpt-4o
795
+
796
+ security:
797
+ authentication:
798
+ required: true
799
+ type: oauth2
800
+ authorization:
801
+ rbac:
802
+ enabled: true
803
+ session:
804
+ timeout_seconds: 3600
805
+ require_reauth: true
806
+ change_management:
807
+ enabled: true
808
+ approval_required: true
809
+ track_all_changes: true
810
+
811
+ state:
812
+ enabled: true
813
+ encryption:
814
+ enabled: true
815
+ algorithm: AES-256-GCM
816
+ backup:
817
+ enabled: true
818
+ frequency: daily
819
+ retention_days: 90
820
+
821
+ reliability:
822
+ retry:
823
+ enabled: true
824
+ max_attempts: 3
825
+ circuit_breaker:
826
+ enabled: true
827
+ failure_threshold: 5
828
+ fallback:
829
+ enabled: true
830
+
831
+ observability:
832
+ logging:
833
+ enabled: true
834
+ level: info
835
+ structured: true
836
+ tamper_evident: true
837
+ retention_days: 365
838
+ monitoring:
839
+ enabled: true
840
+ alerting:
841
+ enabled: true
842
+ channels:
843
+ - type: pagerduty
844
+ severity: high
845
+ metrics:
846
+ enabled: true
847
+ availability_tracking: true
848
+ sla_target: 99.9
849
+
850
+ data:
851
+ classification:
852
+ enabled: true
853
+ levels: [public, internal, confidential, restricted]
854
+ retention_policy:
855
+ enabled: true
856
+ default_retention_days: 365
857
+ disposal:
858
+ method: secure_delete
859
+ verification: required
860
+ ```
861
+
862
+ #### fixtures/enterprise/gdpr-compliant.yml
863
+
864
+ ```yaml
865
+ apiVersion: ossa/v0.2.9
866
+ kind: Agent
867
+ metadata:
868
+ name: gdpr-agent
869
+ version: 1.0.0
870
+ annotations:
871
+ compliance.framework: GDPR
872
+ dpia.completed: "true"
873
+ dpia.date: "2025-01-10"
874
+ dpo.assigned: "true"
875
+
876
+ spec:
877
+ role: "GDPR-compliant agent for EU data processing"
878
+ capabilities:
879
+ - urn:ossa:capability:chat
880
+ - urn:ossa:capability:personal-data
881
+
882
+ compliance:
883
+ profiles:
884
+ - gdpr
885
+ audit:
886
+ enabled: true
887
+ retention_days: 365
888
+ personal_data_logging: minimized
889
+
890
+ llm:
891
+ provider: openai
892
+ model: gpt-4o
893
+ parameters:
894
+ temperature: 0.7
895
+
896
+ security:
897
+ authentication:
898
+ required: true
899
+ type: oauth2
900
+
901
+ safety:
902
+ content_filtering:
903
+ enabled: true
904
+ personal_data_detection: true
905
+
906
+ state:
907
+ enabled: true
908
+ encryption:
909
+ enabled: true
910
+ algorithm: AES-256-GCM
911
+ storage:
912
+ backend: postgresql
913
+ region: eu-west-1
914
+ data_residency: EU
915
+ retention:
916
+ purpose_limitation: true
917
+ right_to_erasure: true
918
+ data_portability:
919
+ enabled: true
920
+ formats: [json, csv, xml]
921
+
922
+ tools:
923
+ - name: query_user_data
924
+ description: "Query user personal data"
925
+ input_schema:
926
+ type: object
927
+ properties:
928
+ user_id:
929
+ type: string
930
+ required: [user_id]
931
+ source:
932
+ type: http
933
+ uri: https://api.example.eu/users
934
+ method: GET
935
+ tls:
936
+ enabled: true
937
+ min_version: "1.3"
938
+ data_processing:
939
+ purpose_specification: "User account management"
940
+ consent_verification: required
941
+ legal_basis: consent
942
+ approval_required: true
943
+
944
+ - name: export_user_data
945
+ description: "Export user data (Article 20 - Right to Data Portability)"
946
+ input_schema:
947
+ type: object
948
+ properties:
949
+ user_id:
950
+ type: string
951
+ format:
952
+ type: string
953
+ enum: [json, csv, xml]
954
+ required: [user_id, format]
955
+ source:
956
+ type: function
957
+ implementation: |
958
+ async function export_user_data(input) {
959
+ const data = await state.get(`user:${input.user_id}`);
960
+ return formatData(data, input.format);
961
+ }
962
+
963
+ - name: delete_user_data
964
+ description: "Delete user data (Article 17 - Right to Erasure)"
965
+ input_schema:
966
+ type: object
967
+ properties:
968
+ user_id:
969
+ type: string
970
+ required: [user_id]
971
+ source:
972
+ type: function
973
+ implementation: |
974
+ async function delete_user_data(input) {
975
+ await state.delete(`user:${input.user_id}`);
976
+ return { deleted: true, user_id: input.user_id };
977
+ }
978
+ approval_required: true
979
+
980
+ observability:
981
+ logging:
982
+ enabled: true
983
+ level: info
984
+ personal_data_minimization: true
985
+ retention_days: 365
986
+ consent_tracking:
987
+ enabled: true
988
+ log_all_consent: true
989
+
990
+ data:
991
+ personal_data_detection: required
992
+ anonymization:
993
+ enabled: true
994
+ techniques: [k-anonymity, differential-privacy]
995
+ pseudonymization:
996
+ enabled: true
997
+ rights:
998
+ access: enabled
999
+ rectification: enabled
1000
+ erasure: enabled
1001
+ portability: enabled
1002
+ object: enabled
1003
+ ```
1004
+
1005
+ ### 3.4 Interoperability Fixtures
1006
+
1007
+ #### fixtures/interop/a2a-delegation.yml
1008
+
1009
+ ```yaml
1010
+ apiVersion: ossa/v0.2.9
1011
+ kind: Agent
1012
+ metadata:
1013
+ name: supervisor-a2a
1014
+ version: 1.0.0
1015
+ spec:
1016
+ role: "Supervisor agent for A2A protocol testing"
1017
+ capabilities:
1018
+ - urn:ossa:capability:supervisor
1019
+ - urn:ossa:capability:a2a
1020
+
1021
+ llm:
1022
+ provider: openai
1023
+ model: gpt-4o
1024
+
1025
+ delegation:
1026
+ enabled: true
1027
+ protocol: a2a
1028
+ discovery:
1029
+ method: registry
1030
+ registry_uri: http://localhost:8080/agents
1031
+
1032
+ tools:
1033
+ - name: delegate_to_specialist
1034
+ description: "Delegate task to specialist agent"
1035
+ input_schema:
1036
+ type: object
1037
+ properties:
1038
+ specialist_capability:
1039
+ type: string
1040
+ task:
1041
+ type: string
1042
+ required: [specialist_capability, task]
1043
+ source:
1044
+ type: delegation
1045
+ protocol: a2a
1046
+ capability_match: true
1047
+ timeout_ms: 30000
1048
+ ```
1049
+
1050
+ ---
1051
+
1052
+ ## 4. Certification Badge
1053
+
1054
+ ### 4.1 Badge Format
1055
+
1056
+ Conformant agents MAY display certification badges in their documentation:
1057
+
1058
+ ```markdown
1059
+ [![OSSA Conformance](https://ossa.ai/badge/v0.2.9/basic)](https://ossa.ai/certifications/basic/agent-id)
1060
+ [![OSSA Conformance](https://ossa.ai/badge/v0.2.9/standard)](https://ossa.ai/certifications/standard/agent-id)
1061
+ [![OSSA Conformance](https://ossa.ai/badge/v0.2.9/enterprise/fedramp)](https://ossa.ai/certifications/enterprise/agent-id)
1062
+ ```
1063
+
1064
+ **Badge Levels**:
1065
+ - ![Basic](https://img.shields.io/badge/OSSA-Basic-green) - Schema valid, basic checks pass
1066
+ - ![Standard](https://img.shields.io/badge/OSSA-Standard-blue) - Runtime semantics compliant
1067
+ - ![Enterprise](https://img.shields.io/badge/OSSA-Enterprise-purple) - Security + compliance validated
1068
+
1069
+ ### 4.2 Certification Metadata
1070
+
1071
+ ```yaml
1072
+ apiVersion: ossa/v0.2.9
1073
+ kind: Agent
1074
+ metadata:
1075
+ name: certified-agent
1076
+ version: 1.0.0
1077
+ annotations:
1078
+ ossa.ai/conformance-level: enterprise
1079
+ ossa.ai/conformance-profile: fedramp-moderate
1080
+ ossa.ai/certification-date: "2025-12-04"
1081
+ ossa.ai/certification-expiry: "2026-12-04"
1082
+ ossa.ai/certification-id: "ossa-cert-abc123"
1083
+ spec:
1084
+ # ... agent spec
1085
+ ```
1086
+
1087
+ ### 4.3 Certification Expiration
1088
+
1089
+ - **Basic**: No expiration (spec version locked)
1090
+ - **Standard**: 1 year expiration (runtime semantics may evolve)
1091
+ - **Enterprise**: 1 year expiration (compliance frameworks update annually)
1092
+
1093
+ **Re-certification**:
1094
+ ```bash
1095
+ # Check if certification is still valid
1096
+ ossa validate agent.yml --check-certification
1097
+
1098
+ # Re-certify after updates
1099
+ ossa certify agent.yml --level=enterprise --profile=fedramp-moderate
1100
+ ```
1101
+
1102
+ ---
1103
+
1104
+ ## 5. Validation CLI
1105
+
1106
+ ### 5.1 Basic Validation
1107
+
1108
+ ```bash
1109
+ # Validate schema only
1110
+ ossa validate agent.yml
1111
+
1112
+ # Verbose output
1113
+ ossa validate agent.yml --verbose
1114
+
1115
+ # JSON output for CI/CD
1116
+ ossa validate agent.yml --format=json
1117
+ ```
1118
+
1119
+ **Output** (JSON):
1120
+ ```json
1121
+ {
1122
+ "level": "basic",
1123
+ "status": "passed",
1124
+ "tests": {
1125
+ "schema": "passed",
1126
+ "required_fields": "passed",
1127
+ "semver": "passed",
1128
+ "uris": "passed"
1129
+ },
1130
+ "timestamp": "2025-12-04T12:00:00Z"
1131
+ }
1132
+ ```
1133
+
1134
+ ### 5.2 Standard Validation
1135
+
1136
+ ```bash
1137
+ # Standard conformance (requires runtime)
1138
+ ossa validate agent.yml --level=standard
1139
+
1140
+ # Skip slow tests
1141
+ ossa validate agent.yml --level=standard --skip=performance
1142
+
1143
+ # Test specific runtime
1144
+ ossa validate agent.yml --level=standard --runtime=./path/to/runtime
1145
+ ```
1146
+
1147
+ **Output**:
1148
+ ```json
1149
+ {
1150
+ "level": "standard",
1151
+ "status": "passed",
1152
+ "tests": {
1153
+ "basic": "passed",
1154
+ "turn_lifecycle": "passed",
1155
+ "error_handling": "passed",
1156
+ "state_management": "passed",
1157
+ "observability": "passed"
1158
+ },
1159
+ "runtime": {
1160
+ "name": "ossa-runtime-typescript",
1161
+ "version": "0.2.9"
1162
+ },
1163
+ "timestamp": "2025-12-04T12:00:00Z",
1164
+ "duration_ms": 12345
1165
+ }
1166
+ ```
1167
+
1168
+ ### 5.3 Enterprise Validation
1169
+
1170
+ ```bash
1171
+ # Enterprise conformance with compliance profile
1172
+ ossa validate agent.yml --level=enterprise --profile=fedramp-moderate
1173
+
1174
+ # Multiple profiles
1175
+ ossa validate agent.yml --level=enterprise --profile=hipaa,soc2-type2
1176
+
1177
+ # Generate compliance report (PDF)
1178
+ ossa compliance-report agent.yml --profile=fedramp-moderate --format=pdf --output=report.pdf
1179
+ ```
1180
+
1181
+ **Output**:
1182
+ ```json
1183
+ {
1184
+ "level": "enterprise",
1185
+ "status": "passed",
1186
+ "profiles": ["fedramp-moderate"],
1187
+ "tests": {
1188
+ "standard": "passed",
1189
+ "security": "passed",
1190
+ "compliance": "passed",
1191
+ "audit_logging": "passed",
1192
+ "encryption": "passed"
1193
+ },
1194
+ "controls": {
1195
+ "total": 110,
1196
+ "passed": 110,
1197
+ "failed": 0
1198
+ },
1199
+ "certification": {
1200
+ "id": "ossa-cert-abc123",
1201
+ "issued": "2025-12-04T12:00:00Z",
1202
+ "expires": "2026-12-04T12:00:00Z"
1203
+ }
1204
+ }
1205
+ ```
1206
+
1207
+ ### 5.4 List Available Profiles
1208
+
1209
+ ```bash
1210
+ # List all compliance profiles
1211
+ ossa profiles list
1212
+
1213
+ # Show profile details
1214
+ ossa profiles show fedramp-moderate
1215
+ ```
1216
+
1217
+ **Output**:
1218
+ ```
1219
+ Available Compliance Profiles:
1220
+
1221
+ fedramp-moderate FedRAMP Moderate Baseline (110 controls)
1222
+ fedramp-high FedRAMP High Baseline (325 controls)
1223
+ soc2-type2 SOC 2 Type II
1224
+ hipaa HIPAA Security and Privacy Rules
1225
+ gdpr GDPR (EU Data Protection)
1226
+ pci-dss-4.0 PCI DSS v4.0
1227
+ iso27001-2022 ISO/IEC 27001:2022
1228
+
1229
+ Use 'ossa profiles show <profile>' for details.
1230
+ ```
1231
+
1232
+ ---
1233
+
1234
+ ## 6. CI/CD Integration
1235
+
1236
+ ### 6.1 GitLab CI
1237
+
1238
+ ```yaml
1239
+ # .gitlab-ci.yml
1240
+ stages:
1241
+ - validate
1242
+ - test
1243
+ - certify
1244
+
1245
+ ossa:validate:
1246
+ stage: validate
1247
+ image: ossa/cli:latest
1248
+ script:
1249
+ - ossa validate agents/**/*.yml --level=basic --format=junit
1250
+ artifacts:
1251
+ reports:
1252
+ junit: ossa-validation-report.xml
1253
+
1254
+ ossa:test:
1255
+ stage: test
1256
+ image: ossa/cli:latest
1257
+ script:
1258
+ - ossa validate agents/**/*.yml --level=standard --format=junit
1259
+ artifacts:
1260
+ reports:
1261
+ junit: ossa-standard-report.xml
1262
+ only:
1263
+ - merge_requests
1264
+ - main
1265
+
1266
+ ossa:certify:
1267
+ stage: certify
1268
+ image: ossa/cli:latest
1269
+ script:
1270
+ - ossa validate agents/production/*.yml --level=enterprise --profile=$COMPLIANCE_PROFILE
1271
+ - ossa certify agents/production/*.yml --level=enterprise --output=certifications/
1272
+ artifacts:
1273
+ paths:
1274
+ - certifications/
1275
+ only:
1276
+ - tags
1277
+ when: manual
1278
+ ```
1279
+
1280
+ ### 6.2 GitHub Actions
1281
+
1282
+ ```yaml
1283
+ # .github/workflows/ossa-conformance.yml
1284
+ name: OSSA Conformance Testing
1285
+
1286
+ on:
1287
+ pull_request:
1288
+ paths:
1289
+ - 'agents/**/*.yml'
1290
+ push:
1291
+ branches:
1292
+ - main
1293
+
1294
+ jobs:
1295
+ validate-basic:
1296
+ runs-on: ubuntu-latest
1297
+ steps:
1298
+ - uses: actions/checkout@v4
1299
+ - name: Install OSSA CLI
1300
+ run: npm install -g @ossa/cli
1301
+ - name: Validate Schemas
1302
+ run: ossa validate agents/**/*.yml --level=basic --format=json > validation-report.json
1303
+ - name: Upload Report
1304
+ uses: actions/upload-artifact@v4
1305
+ with:
1306
+ name: validation-report
1307
+ path: validation-report.json
1308
+
1309
+ test-standard:
1310
+ runs-on: ubuntu-latest
1311
+ needs: validate-basic
1312
+ steps:
1313
+ - uses: actions/checkout@v4
1314
+ - name: Install OSSA CLI
1315
+ run: npm install -g @ossa/cli
1316
+ - name: Runtime Tests
1317
+ run: ossa validate agents/**/*.yml --level=standard --format=junit
1318
+ - name: Publish Test Results
1319
+ uses: EnricoMi/publish-unit-test-result-action@v2
1320
+ if: always()
1321
+ with:
1322
+ files: ossa-test-results.xml
1323
+
1324
+ certify-enterprise:
1325
+ runs-on: ubuntu-latest
1326
+ needs: test-standard
1327
+ if: github.ref == 'refs/heads/main'
1328
+ steps:
1329
+ - uses: actions/checkout@v4
1330
+ - name: Install OSSA CLI
1331
+ run: npm install -g @ossa/cli
1332
+ - name: Enterprise Validation
1333
+ run: ossa validate agents/production/*.yml --level=enterprise --profile=${{ secrets.COMPLIANCE_PROFILE }}
1334
+ - name: Generate Certification
1335
+ run: ossa certify agents/production/*.yml --level=enterprise --output=certifications/
1336
+ - name: Upload Certifications
1337
+ uses: actions/upload-artifact@v4
1338
+ with:
1339
+ name: certifications
1340
+ path: certifications/
1341
+ ```
1342
+
1343
+ ### 6.3 Pre-commit Hook
1344
+
1345
+ ```bash
1346
+ # .git/hooks/pre-commit
1347
+ #!/bin/bash
1348
+
1349
+ echo "Running OSSA conformance validation..."
1350
+
1351
+ # Find all changed YAML files in agents/ directory
1352
+ changed_files=$(git diff --cached --name-only --diff-filter=ACM | grep 'agents/.*\.yml$')
1353
+
1354
+ if [ -z "$changed_files" ]; then
1355
+ echo "No agent manifests changed, skipping validation."
1356
+ exit 0
1357
+ fi
1358
+
1359
+ # Validate each changed file
1360
+ for file in $changed_files; do
1361
+ echo "Validating $file..."
1362
+ ossa validate "$file" --level=basic --quiet
1363
+
1364
+ if [ $? -ne 0 ]; then
1365
+ echo "❌ Validation failed for $file"
1366
+ echo "Run 'ossa validate $file --verbose' for details"
1367
+ exit 1
1368
+ fi
1369
+ done
1370
+
1371
+ echo "✅ All agent manifests passed validation"
1372
+ exit 0
1373
+ ```
1374
+
1375
+ ---
1376
+
1377
+ ## 7. Test Execution
1378
+
1379
+ ### 7.1 Running Test Suites
1380
+
1381
+ ```bash
1382
+ # Run all conformance tests
1383
+ ossa test conformance
1384
+
1385
+ # Run specific test category
1386
+ ossa test conformance --category=schema
1387
+ ossa test conformance --category=runtime
1388
+ oss test conformance --category=security
1389
+
1390
+ # Run tests for specific fixtures
1391
+ ossa test conformance --fixtures=fixtures/basic/**
1392
+ ossa test conformance --fixtures=fixtures/enterprise/fedramp-compliant.yml
1393
+
1394
+ # Generate test report
1395
+ ossa test conformance --report=html --output=conformance-report.html
1396
+ ```
1397
+
1398
+ ### 7.2 Test Output Format
1399
+
1400
+ ```bash
1401
+ # JUnit XML (for CI/CD)
1402
+ ossa test conformance --format=junit --output=junit-report.xml
1403
+
1404
+ # JSON (for programmatic parsing)
1405
+ ossa test conformance --format=json --output=test-results.json
1406
+
1407
+ # HTML (for human review)
1408
+ ossa test conformance --format=html --output=test-report.html
1409
+
1410
+ # TAP (Test Anything Protocol)
1411
+ ossa test conformance --format=tap
1412
+ ```
1413
+
1414
+ ### 7.3 Custom Test Suites
1415
+
1416
+ ```yaml
1417
+ # custom-tests.yml
1418
+ name: Custom Conformance Suite
1419
+ version: 1.0.0
1420
+ tests:
1421
+ - name: Validate Production Agents
1422
+ type: schema
1423
+ fixtures:
1424
+ - agents/production/**/*.yml
1425
+ level: enterprise
1426
+ profiles:
1427
+ - fedramp-moderate
1428
+
1429
+ - name: Runtime Semantics
1430
+ type: runtime
1431
+ fixtures:
1432
+ - fixtures/standard/**/*.yml
1433
+ timeout: 300
1434
+
1435
+ - name: Security Baseline
1436
+ type: security
1437
+ fixtures:
1438
+ - agents/**/*.yml
1439
+ checks:
1440
+ - no_secrets
1441
+ - tls_required
1442
+ - encryption_at_rest
1443
+ ```
1444
+
1445
+ **Run custom suite**:
1446
+ ```bash
1447
+ ossa test conformance --suite=custom-tests.yml
1448
+ ```
1449
+
1450
+ ---
1451
+
1452
+ ## 8. Compliance Requirements
1453
+
1454
+ ### 8.1 MUST Requirements
1455
+
1456
+ 1. Runtimes MUST pass Basic conformance for schema validation
1457
+ 2. Runtimes MUST implement all 7 turn lifecycle phases for Standard conformance
1458
+ 3. Runtimes MUST handle all 14 error codes for Standard conformance
1459
+ 4. Runtimes MUST enforce compliance profile requirements when declared
1460
+ 5. Validation tools MUST fail on missing required fields
1461
+ 6. Certification MUST expire after 1 year for Standard/Enterprise levels
1462
+
1463
+ ### 8.2 SHOULD Requirements
1464
+
1465
+ 1. Runtimes SHOULD provide validation CLI tools
1466
+ 2. Agents SHOULD display conformance badges in documentation
1467
+ 3. CI/CD pipelines SHOULD include conformance validation
1468
+ 4. Test fixtures SHOULD cover all error conditions
1469
+ 5. Certification reports SHOULD be machine-readable (JSON/XML)
1470
+
1471
+ ### 8.3 MAY Requirements
1472
+
1473
+ 1. Runtimes MAY provide custom test suites
1474
+ 2. Agents MAY certify against multiple compliance profiles
1475
+ 3. Tools MAY integrate with third-party security scanners
1476
+ 4. Fixtures MAY include performance benchmarks
1477
+
1478
+ ---
1479
+
1480
+ ## 9. References
1481
+
1482
+ - [OSSA Schema v0.2.9](./ossa-0.2.9.schema.json)
1483
+ - [Runtime Semantics](./runtime-semantics.md)
1484
+ - [Compliance Profiles](./compliance-profiles.md)
1485
+ - [Semantic Conventions](./semantic-conventions.md)
1486
+ - [JSON Schema Specification](https://json-schema.org/)
1487
+ - [OpenTelemetry Specification](https://opentelemetry.io/docs/specs/)
1488
+
1489
+ ---
1490
+
1491
+ ## Appendix A: Full Test Matrix
1492
+
1493
+ | Test Category | Basic | Standard | Enterprise |
1494
+ |---------------|-------|----------|------------|
1495
+ | Schema Validation | ✅ | ✅ | ✅ |
1496
+ | Required Fields | ✅ | ✅ | ✅ |
1497
+ | Semantic Versioning | ✅ | ✅ | ✅ |
1498
+ | URI Validation | ✅ | ✅ | ✅ |
1499
+ | Turn Lifecycle | ❌ | ✅ | ✅ |
1500
+ | Error Handling | ❌ | ✅ | ✅ |
1501
+ | State Management | ❌ | ✅ | ✅ |
1502
+ | Tool Execution | ❌ | ✅ | ✅ |
1503
+ | Observability | ❌ | ✅ | ✅ |
1504
+ | Security Controls | ❌ | ❌ | ✅ |
1505
+ | Compliance Profiles | ❌ | ❌ | ✅ |
1506
+ | Audit Logging | ❌ | ❌ | ✅ |
1507
+ | Encryption | ❌ | ❌ | ✅ |
1508
+ | Authentication | ❌ | ❌ | ✅ |
1509
+
1510
+ ---
1511
+
1512
+ ## Appendix B: Error Code Reference
1513
+
1514
+ For complete error code taxonomy, see [Runtime Semantics - Section 2](./runtime-semantics.md#2-error-handling).
1515
+
1516
+ **Quick Reference**:
1517
+ - `VALIDATION_ERROR` - Invalid input format (abort, 0 retries)
1518
+ - `TOOL_ERROR` - Tool execution failed (retry, 3 attempts)
1519
+ - `LLM_ERROR` - LLM provider error (retry, 3 attempts)
1520
+ - `RATE_LIMITED` - Rate limit exceeded (retry with backoff, 3 attempts)
1521
+ - `MAX_TURNS_EXCEEDED` - Hit turn limit (escalate, 0 retries)
1522
+
1523
+ ---
1524
+
1525
+ **Document Status**: Draft
1526
+ **Next Review**: 2025-12-18
1527
+ **Maintainer**: OSSA Working Group