Skip to content

RFC-014: Contract Governor Shared Infrastructure — 5. Stipulation Hierarchy

AIGP SpecificationRFC-014: Contract Governor Shared Infrastructure › 5. Stipulation Hierarchy

← 4. Per-Amigo Contracts · Section index · 6. Version Management →

5. Stipulation Hierarchy

Stipulations follow a two-tier hierarchy: base stipulations from governance-server define the floor, and per-amigo stipulations add domain-specific overrides.

5.1 Hierarchy

governance-server Base Stipulations
Required fields: openapi, info.title,
info.version, paths
OpenAPI major: 3.x
Inject metadata: true
Audit required: true
Safety enforced: true
Enforce version alignment: true
inherited by all amigos
identity-service analytics-service governance-server runbook-service
overrides overrides overrides overrides

5.2 Base Stipulation (from governance-server)

Every amigo inherits these baseline rules:

# Base stipulation enforced everywhere
required_fields:
- openapi
- info.title
- info.version
- paths
require_openapi_major: '3.'
inject_metadata: true
metadata_block:
safety_enforced: true
audit_required: true
governance_app: governance-server
data_classification: internal
security_level: high
enforce_version_alignment: true

5.3 Per-Amigo Override (identity-service example)

identity-service/ingredients/stipulation-gandalf-v1.yaml
stipulation_id: gandalf:v1
stipulation_version: 1.0.0
exposure_policy: private
extension_namespace: x-gandalf
metadata_block:
platform: Gandalf Wizard Framework # override
governance_app: governance-server # inherited

5.4 Per-Amigo Override (analytics-service example)

analytics-service/ingredients/stipulation-ana-gandalf-v1.yaml
stipulation_id: ana-gandalf:v1
stipulation_version: 1.0.0
exposure_policy: private
extension_namespace: x-ana-gandalf
metadata_block:
platform: ANA Gandalf Conversion Framework # override
governance_app: analytics-service # override
gandalf_governance:
allowed_operations:
- uploadPolicies
- convertPolicies
- analyzeGaps
- reviewPolicy
- exportPolicies
require_human_review_before_export: true
conversion_guardrails:
max_upload_size_mb: 200
max_policies_per_upload: 5000
supported_source_platforms: [prisma, wiz, custom]

5.5 Merge Rules

Field Behavior
required_fields Union amigo adds, never removes
metadata_block Deep merge amigo overrides specific keys
allowed_operations Per-amigo only no inheritance
blocked_operations Union amigo adds, never removes
exposure_policy Per-amigo overrides base
extension_namespace Per-amigo only
enforce_version_alignment Base wins cannot be disabled

← 4. Per-Amigo Contracts · Section index · 6. Version Management →