AI-SDLC
AI-SDLC

AI-SDLC Framework Specification

AI-SDLC Framework Specification

Document type: Normative Status: Draft Spec version: v1alpha1


Table of Contents

  1. Introduction and Document Conventions
  2. Resource Model
  3. Metadata Object
  4. The Spec/Status Split
  5. Core Resource Types
  6. Conditions
  7. Schema Validation
  8. Versioning
  9. Reconciliation Semantics
  10. Extensibility
  11. Conformance Levels

Document Map

DocumentTypeDescription
spec.md (this document)NormativeCore resource model, validation rules, reconciliation semantics
primer.mdInformativeConcepts, architecture rationale, getting started
adapters.mdNormativeAdapter interface contracts, registration, discovery
policy.mdNormativeQuality gate schema, enforcement levels, evaluation
autonomy.mdNormativeAutonomy levels, promotion criteria, demotion triggers
agents.mdNormativeAgent roles, handoff contracts, orchestration
metrics.mdNormativeMetric definitions, observability conventions
glossary.mdInformativeTerm definitions

1. Introduction and Document Conventions

1.1 Purpose

This document defines the core resource model, resource types, validation requirements, and reconciliation semantics for the AI-SDLC Framework. It is the foundational normative document upon which all other specification documents depend.

1.2 Notational Conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

When these keywords appear in lowercase, they carry their normal English meaning and are not to be interpreted as RFC 2119 keywords.

1.3 Terminology

Terms defined in the glossary are used throughout this document. On first use, terms link to their glossary definition.


2. Resource Model

Every AI-SDLC resource MUST carry five top-level fields:

apiVersion: ai-sdlc.io/v1alpha1
kind: <ResourceType>
metadata:
  name: <unique-name>
  namespace: <team-or-project>
  labels: {}
  annotations: {}
spec: {}
status: {}
FieldTypeRequiredDescription
apiVersionstringMUSTThe API version of the resource. Format: ai-sdlc.io/<version>.
kindstringMUSTThe resource type. One of: Pipeline, AgentRole, QualityGate, AutonomyPolicy, AdapterBinding.
metadataobjectMUSTIdentifying information for the resource. See Section 3.
specobjectMUSTThe desired state declared by the user.
statusobjectMAYThe observed state reported by the system.

The apiVersion field MUST be set to ai-sdlc.io/v1alpha1 for all resources defined in this version of the specification.

The kind field MUST be one of the five core resource types defined in Section 5, or a custom resource type as defined in Section 10.

Implementations MUST reject resources with unrecognized apiVersion or kind values unless the implementation supports custom resource types and the resource conforms to the extensibility model.


3. Metadata Object

The metadata object MUST contain the following fields:

FieldTypeRequiredDescription
namestringMUSTA unique identifier within the namespace. MUST match the pattern ^[a-z][a-z0-9-]*$ and MUST NOT exceed 253 characters.
namespacestringSHOULDThe scoping unit, typically a team or project identifier. MUST match the pattern ^[a-z][a-z0-9-]*$ when provided.
labelsmap[string]stringMAYArbitrary key-value pairs for selection and filtering. See Section 3.1.
annotationsmap[string]stringMAYNon-identifying key-value pairs for tooling and operational metadata. See Section 3.2.

Resource names MUST be unique within a namespace for a given kind. The combination of namespace, kind, and name uniquely identifies a resource.

3.1 Labels

Labels are key-value pairs attached to resources for identification and selection. Label keys and values MUST be strings. Label keys SHOULD follow the format prefix/name where the prefix is a DNS subdomain (e.g., team.example.com/tier). Labels without a prefix are reserved for end-user use.

Labels MAY be used by implementations to filter, select, and group resources. Quality gates and policies MAY use label selectors to target specific resources.

3.2 Annotations

Annotations are key-value pairs attached to resources for non-identifying metadata. Annotations MUST NOT be used for selection or filtering by the framework. Annotations are intended for:

  • Build and release provenance
  • Tooling configuration hints
  • Links to external documentation or dashboards
  • Operational notes

4. The Spec/Status Split

The spec/status split is the foundational structural pattern of the AI-SDLC Framework.

  • The spec field represents desired state — what the user intends. Users write to spec; the system reads from spec.
  • The status field represents observed state — what the system has detected. The system writes to status; users read from status.

Implementations MUST treat spec as the source of truth for user intent. Implementations MUST NOT modify spec fields except through explicit user action. Implementations SHOULD update status fields to reflect current observed state. The reconciliation loop continuously works to make observed state (status) match desired state (spec).

The status field is OPTIONAL on resource creation. When absent, it indicates the resource has not yet been reconciled.


5. Core Resource Types

The AI-SDLC Framework defines five core resource types. Each resource type has a formal JSON Schema definition in addition to the normative text below.

5.1 Pipeline

A Pipeline defines a complete SDLC workflow from trigger through delivery.

5.1.1 Spec Fields

FieldTypeRequiredDescription
triggersarray[Trigger]MUSTEvents that initiate the pipeline.
providersmap[string]ProviderMUSTTool integrations used by the pipeline.
stagesarray[Stage]MUSTOrdered list of execution stages.
routingRoutingMAYComplexity-based task routing configuration.
branchingBranchingConfigMAYBranch naming, target, and cleanup policy.
pullRequestPullRequestConfigMAYPR creation conventions.
notificationsNotificationsConfigMAYNamed notification templates for pipeline events.

Trigger Object:

FieldTypeRequiredDescription
eventstringMUSTThe event type that triggers the pipeline (e.g., issue.assigned, pr.opened).
filterobjectMAYConditions that must match for the trigger to fire.

Provider Object:

FieldTypeRequiredDescription
typestringMUSTThe adapter type (e.g., linear, github, jira).
configobjectMAYAdapter-specific configuration.

Stage Object:

FieldTypeRequiredDescription
namestringMUSTUnique name within the pipeline.
agentstringMAYReference to an AgentRole resource name.
qualityGatesarray[string]MAYReferences to QualityGate resource names.
onFailureFailurePolicyMAYWhat to do when this stage fails. Defaults to abort.
timeoutstringMAYMaximum stage duration as an ISO 8601 duration (e.g., PT30M).
credentialsCredentialPolicyMAYJIT credential scope and lifetime for this stage.
approvalApprovalPolicyMAYApproval requirements before stage execution.

Routing Object:

FieldTypeRequiredDescription
complexityThresholdsmap[string]ThresholdMAYNamed complexity tiers with score ranges and strategies.

Threshold Object:

FieldTypeRequiredDescription
minintegerMUSTMinimum complexity score (inclusive). Range: 1-10.
maxintegerMUSTMaximum complexity score (inclusive). Range: 1-10.
strategystringMUSTOne of: fully-autonomous, ai-with-review, ai-assisted, human-led.

FailurePolicy Object:

FieldTypeRequiredDescription
strategystringMUSTOne of: abort, retry, pause, continue.
maxRetriesintegerConditionalMaximum retry attempts (1-10). MUST be present when strategy is retry.
retryDelaystringMAYDelay between retries as an ISO 8601 duration (e.g., PT1M).
notificationstringMAYName of a notification template to send on failure.

CredentialPolicy Object:

FieldTypeRequiredDescription
scopearray[string]MUSTPermission scopes required by the stage (minimum 1 item).
ttlstringMAYCredential time-to-live as an ISO 8601 duration. Default: PT10M.
revokeOnCompletebooleanMAYWhether to revoke credentials when the stage completes. Default: true.

ApprovalPolicy Object:

FieldTypeRequiredDescription
requiredbooleanMUSTWhether approval is required for this stage.
tierOverridestringMAYOne of: auto, peer-review, team-lead, security-review.
blockingbooleanMAYWhether the stage blocks until approval is granted. Default: true.
timeoutstringMAYMaximum time to wait for approval as an ISO 8601 duration.
onTimeoutstringMAYOne of: abort, escalate, auto-approve.

BranchingConfig Object:

FieldTypeRequiredDescription
patternstringMUSTBranch name pattern with placeholders (e.g., ai-sdlc/issue-{issueNumber}).
targetBranchstringMAYTarget branch for pull requests. Default: main.
cleanupstringMAYOne of: on-merge, on-close, manual.

PullRequestConfig Object:

FieldTypeRequiredDescription
titleTemplatestringMAYPR title template with placeholders.
descriptionSectionsarray[string]MAYSections to include in the PR description.
includeProvenancebooleanMAYWhether to include AI provenance metadata. Default: true.
closeKeywordstringMAYKeyword used to auto-close the linked issue (e.g., Closes).

NotificationsConfig Object:

FieldTypeRequiredDescription
templatesmap[string]NotificationTemplateMAYNamed notification templates.

NotificationTemplate Object:

FieldTypeRequiredDescription
targetstringMUSTOne of: issue, pr, both.
titlestringMUSTNotification title template.
bodystringMAYNotification body template with placeholders.

5.1.2 Status Fields

FieldTypeDescription
phasestringCurrent pipeline phase. One of: Pending, Running, Succeeded, Failed, Suspended.
activeStagestringName of the currently executing stage.
conditionsarray[Condition]Current state conditions. See Section 6.
stageAttemptsmap[string]integerPer-stage execution attempt counts.
pendingApprovalApprovalStatusApproval details when phase is Suspended.

5.1.3 Example

apiVersion: ai-sdlc.io/v1alpha1
kind: Pipeline
metadata:
  name: feature-delivery
  namespace: team-alpha
spec:
  triggers:
    - event: issue.assigned
      filter: { labels: ["ai-eligible"] }
  providers:
    issueTracker:
      type: linear
      config: { teamId: "ENG" }
    sourceControl:
      type: github
      config: { org: "reliable-genius" }
  stages:
    - name: implement
      agent: code-agent
      qualityGates: [test-coverage, security-scan]
      timeout: PT30M
      credentials:
        scope: ["repo:read", "repo:write"]
        ttl: PT15M
        revokeOnComplete: true
      onFailure:
        strategy: retry
        maxRetries: 2
        retryDelay: PT1M
        notification: agent-failure
    - name: review
      agent: reviewer-agent
      qualityGates: [human-approval]
      approval:
        required: true
        blocking: true
        timeout: PT24H
        onTimeout: abort
    - name: deploy
      agent: deploy-agent
      qualityGates: [staging-verification]
      onFailure:
        strategy: abort
  routing:
    complexityThresholds:
      low: { min: 1, max: 3, strategy: "fully-autonomous" }
      medium: { min: 4, max: 6, strategy: "ai-with-review" }
      high: { min: 7, max: 8, strategy: "ai-assisted" }
      critical: { min: 9, max: 10, strategy: "human-led" }
  branching:
    pattern: "ai-sdlc/issue-{issueNumber}"
    targetBranch: main
    cleanup: on-merge
  pullRequest:
    titleTemplate: "fix: {issueTitle} (#{issueNumber})"
    descriptionSections: [summary, changes, closes]
    includeProvenance: true
    closeKeyword: Closes
  notifications:
    templates:
      agent-failure:
        target: issue
        title: "AI-SDLC: Agent Failed"
        body: "Error during {stageName}: {details}"
      pr-created:
        target: issue
        title: "AI-SDLC: PR Created"
        body: "Pull request: {prUrl}"
status:
  phase: Running
  activeStage: implement
  stageAttempts:
    implement: 1
  conditions:
    - type: Healthy
      status: "True"
      lastTransitionTime: "2026-02-07T10:00:00Z"

5.2 AgentRole

An AgentRole declares an AI agent's identity, capabilities, constraints, and handoff behavior. It combines the Role-Goal-Backstory pattern with A2A Agent Card discovery.

5.2.1 Spec Fields

FieldTypeRequiredDescription
rolestringMUSTThe agent's role title (e.g., "Senior Software Engineer").
goalstringMUSTWhat the agent aims to achieve.
backstorystringMAYContext for the agent's persona and expertise.
toolsarray[string]MUSTTool identifiers the agent is permitted to use.
constraintsConstraintsMAYOperational limits on the agent.
handoffsarray[Handoff]MAYTransitions to other agents.
skillsarray[Skill]MAYDeclared capabilities for discovery.
agentCardAgentCardMAYA2A-compatible discovery information.

Constraints Object:

FieldTypeRequiredDescription
maxFilesPerChangeintegerMAYMaximum files the agent may modify in a single change.
requireTestsbooleanMAYWhether the agent MUST include tests with code changes.
allowedLanguagesarray[string]MAYProgramming languages the agent may produce.
blockedPathsarray[string]MAYGlob patterns for paths the agent MUST NOT modify.

Handoff Object:

FieldTypeRequiredDescription
targetstringMUSTName of the target AgentRole resource.
triggerstringMUSTCondition that initiates the handoff.
contractHandoffContractRefMAYReference to a handoff contract.

HandoffContractRef Object:

FieldTypeRequiredDescription
schemastringMUSTURI or path to the JSON Schema defining the handoff data structure.
requiredFieldsarray[string]MAYFields that MUST be present in the handoff payload.

Skill Object:

FieldTypeRequiredDescription
idstringMUSTUnique skill identifier.
descriptionstringMUSTHuman-readable description of the skill.
tagsarray[string]MAYTags for categorization and discovery.
examplesarray[SkillExample]MAYInput/output examples.

SkillExample Object:

FieldTypeRequiredDescription
inputstringMUSTExample input.
outputstringMUSTExpected output description.

AgentCard Object:

FieldTypeRequiredDescription
endpointstring (URI)MUSTThe agent's service endpoint.
versionstringMUSTAgent card version.
securitySchemesarray[string]MAYSupported authentication methods.

5.2.2 Status Fields

FieldTypeDescription
autonomyLevelintegerCurrent autonomy level (0-3).
totalTasksCompletedintegerCumulative tasks completed.
approvalRatenumberRatio of approved tasks (0.0-1.0).
lastActivestring (date-time)Timestamp of last activity.

5.2.3 Example

apiVersion: ai-sdlc.io/v1alpha1
kind: AgentRole
metadata:
  name: code-agent
spec:
  role: "Senior Software Engineer"
  goal: "Implement features from specifications with clean, tested code"
  backstory: "Expert in TypeScript and Python with focus on testable architecture"
  tools: [code_editor, terminal, git_client, test_runner]
  constraints:
    maxFilesPerChange: 20
    requireTests: true
    allowedLanguages: [python, typescript]
    blockedPaths: ["**/secrets/**", "**/.env*"]
  handoffs:
    - target: reviewer-agent
      trigger: "implementation_complete"
      contract:
        schema: "handoff-schemas/impl-to-review-v1.json"
        requiredFields: [prUrl, testResults, coverageReport, changeSummary]
    - target: tester-agent
      trigger: "implementation_complete"
  skills:
    - id: implement_feature
      description: "Implements features from ticket specifications"
      tags: [coding, implementation]
      examples:
        - input: "Implement user authentication with OAuth2"
          output: "PR with auth module, tests, and documentation"
  agentCard:
    endpoint: "https://agents.internal/code-agent"
    version: "1.0.0"
    securitySchemes: [bearer_token]
status:
  autonomyLevel: 2
  totalTasksCompleted: 142
  approvalRate: 0.94
  lastActive: "2026-02-07T09:45:00Z"

5.3 QualityGate

A QualityGate defines policy rules with graduated enforcement levels, following OPA/Gatekeeper's template/instance separation and Sentinel's three-tier enforcement model.

5.3.1 Spec Fields

FieldTypeRequiredDescription
scopeScopeMAYTargeting criteria for the gate.
gatesarray[Gate]MUSTIndividual gate rules.
evaluationEvaluationMAYWhen and how to evaluate.

Scope Object:

FieldTypeRequiredDescription
repositoriesarray[string]MAYRepository patterns to match (glob).
authorTypesarray[string]MAYAuthor types to target (e.g., ai-agent, human).

Gate Object:

FieldTypeRequiredDescription
namestringMUSTUnique gate name within the QualityGate.
enforcementstringMUSTOne of: advisory, soft-mandatory, hard-mandatory.
ruleRuleMUSTThe evaluation rule. One of: metric-based, tool-based, or reviewer-based.
overrideOverrideMAYOverride configuration. Only valid for soft-mandatory enforcement.

Rule Object (metric-based):

FieldTypeRequiredDescription
metricstringMUSTThe metric to evaluate.
operatorstringMUSTComparison operator: >=, <=, ==, !=, >, <.
thresholdnumberMUSTThe threshold value.

Rule Object (tool-based):

FieldTypeRequiredDescription
toolstringMUSTThe analysis tool to run.
maxSeveritystringMAYMaximum allowed finding severity (e.g., low, medium, high, critical).
rulesetsarray[string]MAYRulesets to enable.

Rule Object (reviewer-based):

FieldTypeRequiredDescription
minimumReviewersintegerMUSTMinimum number of required reviewers.
aiAuthorRequiresExtraReviewerbooleanMAYWhether AI-authored code requires an additional reviewer.

Rule Object (documentation-based):

FieldTypeRequiredDescription
changedFilesRequireDocUpdatebooleanMUSTWhether changed files require documentation updates.

Rule Object (provenance-based):

FieldTypeRequiredDescription
requireAttributionbooleanMUSTWhether AI-generated code requires provenance attribution.
requireHumanReviewbooleanMAYWhether a human review record is required.

Override Object:

FieldTypeRequiredDescription
requiredRolestringMUSTThe role authorized to override.
requiresJustificationbooleanMAYWhether a justification text is required. Default: true.

Evaluation Object:

FieldTypeRequiredDescription
pipelinestringMAYWhen to evaluate (e.g., pre-merge, post-merge, continuous).
timeoutstringMAYMaximum evaluation duration. Format: duration string.
retryPolicyRetryPolicyMAYRetry configuration for failed evaluations.

RetryPolicy Object:

FieldTypeRequiredDescription
maxRetriesintegerMAYMaximum number of retries.
backoffstringMAYBackoff strategy: linear, exponential.

5.3.2 Status Fields

FieldTypeDescription
compliantbooleanWhether all gates are currently passing.
conditionsarray[Condition]Per-gate condition status. See Section 6.

5.3.3 Example

apiVersion: ai-sdlc.io/v1alpha1
kind: QualityGate
metadata:
  name: ai-code-standards
spec:
  scope:
    repositories: ["org/service-*"]
    authorTypes: ["ai-agent"]
  gates:
    - name: test-coverage
      enforcement: soft-mandatory
      rule:
        metric: line-coverage
        operator: ">="
        threshold: 80
      override:
        requiredRole: engineering-manager
        requiresJustification: true
    - name: security-scan
      enforcement: hard-mandatory
      rule:
        tool: semgrep
        maxSeverity: medium
        rulesets: ["owasp-top-10"]
    - name: human-review
      enforcement: hard-mandatory
      rule:
        minimumReviewers: 2
        aiAuthorRequiresExtraReviewer: true
    - name: documentation
      enforcement: advisory
      rule:
        changedFilesRequireDocUpdate: true
    - name: provenance
      enforcement: hard-mandatory
      rule:
        requireAttribution: true
        requireHumanReview: true
  evaluation:
    pipeline: pre-merge
    timeout: 300s
    retryPolicy:
      maxRetries: 3
      backoff: exponential
status:
  compliant: false
  conditions:
    - type: TestCoverage
      status: "False"
      reason: "3 PRs below threshold"
      lastEvaluated: "2026-02-07T09:30:00Z"
    - type: SecurityScan
      status: "True"
    - type: HumanReview
      status: "True"

5.4 AutonomyPolicy

An AutonomyPolicy declares progressive autonomy levels with quantitative promotion criteria and automatic demotion triggers. This is the most novel and differentiated resource type in the framework.

5.4.1 Spec Fields

FieldTypeRequiredDescription
levelsarray[Level]MUSTOrdered list of autonomy levels (0-3).
promotionCriteriamap[string]PromotionCriteriaMUSTKeyed by transition (e.g., 0-to-1).
demotionTriggersarray[DemotionTrigger]MUSTConditions that cause automatic demotion.

Level Object:

FieldTypeRequiredDescription
levelintegerMUSTLevel number (0-3).
namestringMUSTHuman-readable name (e.g., "Intern", "Junior", "Senior", "Principal").
descriptionstringMAYDescription of the level's scope.
permissionsPermissionsMUSTWhat the agent is allowed to do.
guardrailsGuardrailsMUSTOperational constraints.
monitoringstringMUSTMonitoring intensity: continuous, real-time-notification, audit-log.
minimumDurationstringMAYMinimum time at this level before promotion. Format: duration string. Null for no minimum.

Permissions Object:

FieldTypeRequiredDescription
readarray[string]MUSTRead permission scopes (glob patterns).
writearray[string]MUSTWrite permission scopes (action names or glob patterns).
executearray[string]MUSTExecute permission scopes (action names).

Guardrails Object:

FieldTypeRequiredDescription
requireApprovalstringMUSTApproval requirement: all, security-critical-only, architecture-changes-only, none.
maxLinesPerPRintegerMAYMaximum lines changed per pull request.
blockedPathsarray[string]MAYGlob patterns for paths the agent MUST NOT modify.
transactionLimitstringMAYMaximum cost/resource budget per time period.

PromotionCriteria Object:

FieldTypeRequiredDescription
minimumTasksintegerMUSTMinimum tasks completed at current level.
conditionsarray[MetricCondition]MUSTMetric thresholds that must be met.
requiredApprovalsarray[string]MUSTRoles that must approve the promotion.

MetricCondition Object:

FieldTypeRequiredDescription
metricstringMUSTThe metric to evaluate.
operatorstringMUSTComparison operator: >=, <=, ==, !=, >, <.
thresholdnumberMUSTThe threshold value.

DemotionTrigger Object:

FieldTypeRequiredDescription
triggerstringMUSTThe event that triggers demotion.
actionstringMUSTThe demotion action: demote-to-0, demote-one-level.
cooldownstringMUSTTime before re-promotion is possible. Format: duration string.

5.4.2 Status Fields

FieldTypeDescription
agentsarray[AgentStatus]Per-agent autonomy status.

AgentStatus Object:

FieldTypeDescription
namestringAgent name (reference to AgentRole).
currentLevelintegerCurrent autonomy level (0-3).
promotedAtstring (date-time)When the agent was last promoted.
nextEvaluationAtstring (date-time)When the next promotion evaluation occurs.
metricsmap[string]numberCurrent metric values for promotion evaluation.

5.4.3 Example

apiVersion: ai-sdlc.io/v1alpha1
kind: AutonomyPolicy
metadata:
  name: standard-progression
spec:
  levels:
    - level: 0
      name: "Intern"
      description: "Read-only observation, no code generation"
      permissions:
        read: ["*"]
        write: []
        execute: []
      guardrails:
        requireApproval: all
      monitoring: continuous
      minimumDuration: "2w"
    - level: 1
      name: "Junior"
      description: "Recommend changes with mandatory human approval"
      permissions:
        read: ["*"]
        write: ["draft-pr", "comment"]
        execute: ["test-suite"]
      guardrails:
        requireApproval: all
        maxLinesPerPR: 200
        blockedPaths: ["**/auth/**", "**/payment/**"]
      monitoring: continuous
      minimumDuration: "4w"
    - level: 2
      name: "Senior"
      description: "Execute within guardrails with real-time notification"
      permissions:
        read: ["*"]
        write: ["branch", "pr", "comment"]
        execute: ["test-suite", "lint", "build"]
      guardrails:
        requireApproval: security-critical-only
        maxLinesPerPR: 500
        transactionLimit: "$100/day"
        blockedPaths: ["**/auth/**"]
      monitoring: real-time-notification
      minimumDuration: "8w"
    - level: 3
      name: "Principal"
      description: "Autonomous within domain, continuous validation"
      permissions:
        read: ["*"]
        write: ["branch", "pr", "comment", "merge-non-critical"]
        execute: ["test-suite", "lint", "build", "deploy-staging"]
      guardrails:
        requireApproval: architecture-changes-only
        maxLinesPerPR: 1000
      monitoring: audit-log
      minimumDuration: null
  promotionCriteria:
    "0-to-1":
      minimumTasks: 20
      conditions:
        - metric: recommendation-acceptance-rate
          operator: ">="
          threshold: 0.90
        - metric: security-incidents
          operator: "=="
          threshold: 0
      requiredApprovals: [engineering-manager]
    "1-to-2":
      minimumTasks: 50
      conditions:
        - metric: pr-approval-rate
          operator: ">="
          threshold: 0.90
        - metric: rollback-rate
          operator: "<="
          threshold: 0.02
        - metric: average-review-iterations
          operator: "<="
          threshold: 1.5
        - metric: security-incidents
          operator: "=="
          threshold: 0
        - metric: code-coverage-maintained
          operator: ">="
          threshold: 0.80
      requiredApprovals: [engineering-manager, security-lead]
    "2-to-3":
      minimumTasks: 100
      conditions:
        - metric: pr-approval-rate
          operator: ">="
          threshold: 0.95
        - metric: rollback-rate
          operator: "<="
          threshold: 0.01
        - metric: production-incidents-caused
          operator: "=="
          threshold: 0
      requiredApprovals: [engineering-manager, security-lead, vp-engineering]
  demotionTriggers:
    - trigger: critical-security-incident
      action: demote-to-0
      cooldown: "4w"
    - trigger: rollback-rate-exceeds-5-percent
      action: demote-one-level
      cooldown: "2w"
    - trigger: unauthorized-access-attempt
      action: demote-to-0
      cooldown: "4w"
status:
  agents:
    - name: code-agent
      currentLevel: 2
      promotedAt: "2026-01-15T00:00:00Z"
      nextEvaluationAt: "2026-03-15T00:00:00Z"
      metrics:
        prApprovalRate: 0.94
        rollbackRate: 0.01
        reviewIterations: 1.2

5.5 AdapterBinding

An AdapterBinding declares a tool integration as a swappable provider behind a uniform interface contract.

5.5.1 Spec Fields

FieldTypeRequiredDescription
interfacestringMUSTThe abstract contract name. SDLC interfaces: IssueTracker, SourceControl, CIPipeline, CodeAnalysis, Messenger, DeploymentTarget. Infrastructure interfaces: AuditSink, Sandbox, SecretStore, MemoryStore, EventBus. See adapters.md.
typestringMUSTThe concrete implementation (e.g., linear, github, jira).
versionstringMUSTAdapter version (SemVer).
sourcestringMAYLocation of the adapter (registry URI, local path, or git reference).
configobjectMAYAdapter-specific configuration. This field permits additional properties.
healthCheckHealthCheckMAYHealth check configuration.

HealthCheck Object:

FieldTypeRequiredDescription
intervalstringMAYTime between health checks. Format: duration string.
timeoutstringMAYMaximum time to wait for a health check response. Format: duration string.

5.5.2 Status Fields

FieldTypeDescription
connectedbooleanWhether the adapter is currently connected.
lastHealthCheckstring (date-time)Timestamp of the last successful health check.
adapterVersionstringThe running adapter version.
specVersionSupportedstringThe spec version the adapter supports.

5.5.3 Example

apiVersion: ai-sdlc.io/v1alpha1
kind: AdapterBinding
metadata:
  name: linear-tracker
spec:
  interface: IssueTracker
  type: linear
  version: "1.2.0"
  source: "registry.ai-sdlc.io/adapters/linear"
  config:
    apiKey:
      secretRef: linear-api-key
    teamId: "ENG"
    defaultLabels: ["ai-sdlc-managed"]
  healthCheck:
    interval: 60s
    timeout: 10s
status:
  connected: true
  lastHealthCheck: "2026-02-07T10:00:00Z"
  adapterVersion: "1.2.0"
  specVersionSupported: "v1alpha1"

6. Conditions

Conditions represent individual aspects of a resource's observed state. They appear in the status.conditions array of any resource.

Every condition MUST contain the following fields:

FieldTypeRequiredDescription
typestringMUSTThe aspect of state this condition represents (e.g., Healthy, TestCoverage, SecurityScan).
statusstringMUSTOne of: True, False, Unknown.
reasonstringMAYA machine-readable reason code for the current status.
messagestringMAYA human-readable description of the current status.
lastTransitionTimestring (date-time)SHOULDWhen the condition last transitioned from one status to another.
lastEvaluatedstring (date-time)MAYWhen the condition was last evaluated.

Conditions SHOULD be additive: new condition types MAY be added without removing existing ones. Implementations MUST NOT rely on the absence of a condition type to infer state; instead, Unknown SHOULD be used when a condition has not yet been evaluated.


7. Schema Validation

All resource types MUST define JSON Schema (draft 2020-12) definitions. Schemas are published at the base URL https://ai-sdlc.io/schemas/v1alpha1/ and are available in the schemas/ directory of this repository.

Implementations MUST validate resources against their schema before admission. Specifically, implementations MUST:

  1. Reject unknown fields — Resources with fields not defined in the schema MUST be rejected (equivalent to additionalProperties: false), except for fields explicitly marked as extensible (e.g., AdapterBinding.spec.config).
  2. Enforce required fields — Resources missing required fields MUST be rejected.
  3. Validate types and formats — Field values MUST conform to their declared type, pattern, and format constraints.
  4. Apply defaults — Schema-defined default values SHOULD be applied to omitted optional fields.

Schema files are provided for all core resource types:

SchemaResource
common.schema.jsonShared definitions (metadata, conditions, secretRef)
pipeline.schema.jsonPipeline
agent-role.schema.jsonAgentRole
quality-gate.schema.jsonQualityGate
autonomy-policy.schema.jsonAutonomyPolicy
adapter-binding.schema.jsonAdapterBinding

8. Versioning

8.1 API Version Maturity

The specification follows a Kubernetes-style maturity progression:

StageFormatStability GuaranteeBreaking Changes
Alphav1alpha1, v1alpha2No stability; may be removed without noticeAllowed between alpha versions
Betav1beta1, v1beta29 months of support after deprecationAllowed between beta versions
GAv1, v212 months of support after deprecationOnly between major versions

The current specification version is v1alpha1. All resources MUST set apiVersion to ai-sdlc.io/v1alpha1.

8.2 Component-Level Stability

Individual components (adapters, policy templates, agent roles) carry their own stability level independent of the specification version. Stability levels follow the progression:

Development -> Alpha -> Beta -> Stable -> Deprecated -> Removed

Each component declares its stability in its metadata.yaml file. See adapters.md for the metadata format.

8.3 Backward Compatibility

Within a given API version:

  • New optional fields MAY be added to resource specs without a version bump
  • Required fields MUST NOT be added without a new API version
  • Existing field semantics MUST NOT change without a new API version
  • Enum values MAY be added but MUST NOT be removed without a new API version

9. Reconciliation Semantics

The reconciliation loop is the runtime heart of the AI-SDLC Framework. It follows the Kubernetes controller pattern: desired state -> observe -> diff -> act -> loop.

9.1 The Core Loop

1. DESIRED STATE — Read Pipeline, QualityGate, AutonomyPolicy resources
2. OBSERVE       — Watch development activity via adapters
3. DIFF          — Compare actual metrics against policy thresholds
4. ACT           — Enforce based on enforcement level
5. REMEDIATE     — Auto-heal (generate tests, assign reviewers, create tickets)
6. UPDATE STATUS — Write to resource status.conditions[]
7. REQUEUE       — Schedule next reconciliation (event-driven + periodic)

9.2 Required Properties

Implementations of the reconciliation engine MUST exhibit the following properties:

  1. Level-triggered, not edge-triggered — Decisions MUST be based on the current state difference between spec and status, not on specific events that occurred. This ensures correct behavior regardless of missed events.

  2. Idempotent — The same reconciliation MUST produce the same result regardless of how many times it is invoked. Implementations MUST NOT produce side effects that accumulate on repeated invocation.

  3. Eventually consistent — The system MUST converge toward the desired state over time through repeated reconciliation cycles. Temporary inconsistency is acceptable.

  4. Rate-limited with backoff — Implementations MUST rate-limit reconciliation cycles. On error, implementations MUST use exponential backoff. Work queues SHOULD deduplicate pending reconciliation requests for the same resource.

  5. Filtered — Implementations MUST use predicates to ignore status-only updates. A controller's own status writes MUST NOT trigger re-reconciliation of the same resource (preventing infinite loops).

9.3 Reconciliation Results

Each reconciliation cycle MUST return one of:

ResultBehavior
SuccessDone until next event or periodic check
ErrorRequeue with exponential backoff
Explicit RequeueImmediate retry
Delayed RequeueCheck again after specified duration

10. Extensibility

10.1 Custom Resource Types

The AI-SDLC Framework follows a core-plus-extensions model. Implementations MAY support custom resource types beyond the five core types defined in this specification.

Custom resource types:

  • MUST follow the same resource model (apiVersion, kind, metadata, spec, status)
  • MUST provide a JSON Schema definition
  • SHOULD use a custom apiVersion prefix (e.g., extensions.ai-sdlc.io/v1alpha1)
  • MUST NOT use the ai-sdlc.io prefix for custom kinds

10.2 Extension Points

The following fields are designated as explicit extension points where additional properties are permitted:

  • AdapterBinding.spec.config — Adapter-specific configuration (schema validation deferred to the adapter)
  • metadata.annotations — Arbitrary non-identifying metadata
  • metadata.labels — Arbitrary key-value pairs for selection

All other fields enforce additionalProperties: false to maintain schema strictness.


11. Conformance Levels

Implementations declare one of three conformance levels:

LevelRequirements
CorePasses all core resource validation tests. Implements Pipeline and QualityGate resource types. Supports schema validation and the spec/status split.
AdapterMeets Core requirements. Additionally passes adapter interface contract tests for at least one interface contract.
FullMeets Adapter requirements. Additionally passes all tests including autonomy level management, multi-agent orchestration, and reconciliation loop semantics.

Conformance is verified through the language-agnostic conformance test suite in the conformance/ directory. Implementations MUST document which conformance level they target and which spec version they support.