This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: argocd-rollout-analysis-step-lock

Argo CD Progressive Rollout Analysis Step-Lock Invariant

Enforces mandatory inline AnalysisTemplate step-locks and automated abort thresholds within Argo Rollout canary and blue-green strategies. Automated progressive traffic weight advancement must strictly block and abort upon statistical anomaly detection in downstream service latencies (P95/P99) or error budgets.

Prohibited Anti-Pattern: Blind Traffic Escalation Without Downstream Anomaly Analysis Step-Locks

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Argo CD Progressive Rollout Analysis Step-Lock Invariant - Enforces mandatory inline AnalysisTemplate step-locks and automated abort thresholds within Argo Rollout canary and blue-green strategies. Automated progressive traffic weight advancement must strictly block and abort upon statistical anomaly detection in downstream service latencies (P95/P99) or error budgets.
globs: **/rollout*.{yaml,yml}, **/analysis-template*.{yaml,yml}, charts/**/templates/*.{yaml,yml}, manifests/**/*.{yaml,yml}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/argocd-rollout-analysis-step-lock"
---

# Argo CD Progressive Rollout Analysis Step-Lock Invariant

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Blind Traffic Escalation Without Downstream Anomaly Analysis Step-Locks

## System Constraints
You are a Principal Software Architect and SRE Guardrail Author enforcing Argo CD Progressive Rollout Analysis Step-Lock Invariants. You must ensure no progressive traffic shifting (canary/blue-green) occurs without active, synchronized AnalysisTemplate step locks evaluating real-time downstream latency distributions (P95/P99) and telemetry anomaly thresholds. Reject any rollout configuration lacking instantaneous automated abort triggers on downstream latency degradation.

## Strict Guidelines
- Engineers MUST ALWAYS bind an inline `analysis` block or step-level `analysis` reference before and during every canary weight increase in `spec.strategy.canary.steps`.
- Engineers MUST define explicit `failureLimit` thresholds (e.g., `failureLimit: 1` or `2`) with immediate abort actions, rather than relying solely on non-blocking background analysis.
- AnalysisTemplates MUST measure downstream dependency latency (e.g., downstream service response time percentiles via Envoy/Prometheus metrics) in addition to localized ingress response status codes.
- Rollout specs MUST NOT omit `abortScaleDownDelaySeconds` or dynamic metric threshold gates, ensuring faulty revisions are halted and traffic is drained gracefully to stable pods.
- Engineers MUST specify `consecutiveErrorLimit` and realistic `interval`/`count` cadences in metrics providers to prevent flapping while maintaining bounded mean time to detect (MTTD).

## Bad vs Good Implementations
### Argo Rollout Step Analysis with Downstream Latency Guard

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: The rollout relies solely on static pause intervals. Downstream latency anomalies or service degradations will not halt the rollout, exposing 50% or more of production traffic to severe latency degradation or cascading brownouts.
```yaml
# ANTI-PATTERN: Blind time-based step progression without downstream metric analysis
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: order-service
spec:
  replicas: 10
  strategy:
    canary:
      steps:
        - setWeight: 10
        - pause: { duration: 10m }
        - setWeight: 50
        - pause: { duration: 10m }
        # Flaw: No automated metric analysis gates step progression.
        # If downstream payment-service latency spikes, traffic still increases to 50%.

```

#### Production Standard (Correct)
> **Standard**: Traffic weight escalation is step-locked by Prometheus metric evaluation of downstream P99 latency. If downstream latency exceeds the 400ms anomaly limit, failureLimit triggers an immediate rollout abort, preventing traffic escalation and isolating blast radius.
```yaml
# PRODUCTION INVARIANT: Metric-locked canary progression with real-time anomaly aborts
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: order-service
spec:
  replicas: 10
  strategy:
    canary:
      abortScaleDownDelaySeconds: 30
      analysis:
        templates:
          - templateName: downstream-latency-anomaly-guard
        args:
          - name: service-name
            value: order-service
      steps:
        - setWeight: 10
        - pause: { duration: 2m }
        - analysis:
            templates:
              - templateName: downstream-latency-anomaly-guard
            args:
              - name: service-name
                value: order-service
        - setWeight: 25
        - pause: { duration: 5m }
        - analysis:
            templates:
              - templateName: downstream-latency-anomaly-guard
            args:
              - name: service-name
                value: order-service
        - setWeight: 50
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: downstream-latency-anomaly-guard
spec:
  args:
    - name: service-name
  metrics:
    - name: downstream-p99-latency
      interval: 30s
      count: 4
      failureLimit: 1
      successCondition: result[0] <= 0.250
      failureCondition: result[0] > 0.400
      provider:
        prometheus:
          address: http://prometheus-k8s.monitoring:9090
          query: |
            histogram_quantile(0.99, sum(rate(envoy_cluster_upstream_rq_time_bucket{envoy_cluster_name=~"downstream_.*",app="{{args.service-name}}"}[2m])) by (le))

```

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Argo CD Progressive Rollout Analysis Step-Lock Invariant

Argo CD Progressive Rollout Analysis Step-Lock Invariant defines an industrial-grade behavioral standard for devops engineering. Enforces mandatory inline AnalysisTemplate step-locks and automated abort thresholds within Argo Rollout canary and blue-green strategies. Automated progressive traffic weight advancement must strictly block and abort upon statistical anomaly detection in downstream service latencies (P95/P99) or error budgets. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Blind Traffic Escalation Without Downstream Anomaly Analysis Step-Locks Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftBlind Traffic Escalation Without Downstream Anomaly Analysis Step-LocksCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS bind an inline `analysis` block or step-level `analysis` reference before and during every canary weight increase in `spec.strategy.canary.steps`.

Engineers MUST ALWAYS bind an inline `analysis` block or step-level `analysis` reference before and during every canary weight increase in `spec.strategy.canary.steps`.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST define explicit `failureLimit` thresholds (e.g., `failureLimit

Engineers MUST define explicit `failureLimit` thresholds (e.g., `failureLimit: 1` or `2`) with immediate abort actions, rather than relying solely on non-blocking background analysis.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

AnalysisTemplates MUST measure downstream dependency latency (e.g., downstream service response time percentiles via Envoy/Prometheus metrics) in addition to localized ingress response status codes.

AnalysisTemplates MUST measure downstream dependency latency (e.g., downstream service response time percentiles via Envoy/Prometheus metrics) in addition to localized ingress response status codes.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Rollout specs MUST NOT omit `abortScaleDownDelaySeconds` or dynamic metric threshold gates, ensuring faulty revisions are halted and traffic is drained gracefully to stable pods.

Rollout specs MUST NOT omit `abortScaleDownDelaySeconds` or dynamic metric threshold gates, ensuring faulty revisions are halted and traffic is drained gracefully to stable pods.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Engineers MUST specify `consecutiveErrorLimit` and realistic `interval`/`count` cadences in metrics providers to prevent flapping while maintaining bounded mean time to detect (MTTD).

Engineers MUST specify `consecutiveErrorLimit` and realistic `interval`/`count` cadences in metrics providers to prevent flapping while maintaining bounded mean time to detect (MTTD).

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Argo CD Progressive Rollout Analysis Step-Lock Invariant critical for AI coding assistants?

Enforces mandatory inline AnalysisTemplate step-locks and automated abort thresholds within Argo Rollout canary and blue-green strategies. Automated progressive traffic weight advancement must strictly block and abort upon statistical anomaly detection in downstream service latencies (P95/P99) or error budgets. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Blind Traffic Escalation Without Downstream Anomaly Analysis Step-Locks) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Argo